diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5933969590e..aa4edc624b2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -29,6 +29,7 @@ "packages/google-cloud-language": "5.1.2", "packages/google-cloud-memcache": "2.1.4", "packages/google-cloud-monitoring": "3.0.3", + "packages/google-cloud-osconfig": "2.1.2", "packages/google-cloud-oslogin": "4.0.4", "packages/google-cloud-phishingprotection": "3.0.6", "packages/google-cloud-policytroubleshooter": "2.0.6", diff --git a/packages/google-cloud-osconfig/.OwlBot.yaml b/packages/google-cloud-osconfig/.OwlBot.yaml new file mode 100644 index 00000000000..6426171875d --- /dev/null +++ b/packages/google-cloud-osconfig/.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. + +deep-remove-regex: + - /owl-bot-staging + +deep-preserve-regex: + - /owl-bot-staging/v1beta + +deep-copy-regex: + - source: /google/cloud/osconfig/(v.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-osconfig/$1 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-osconfig/.eslintignore b/packages/google-cloud-osconfig/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-osconfig/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-osconfig/.eslintrc.json b/packages/google-cloud-osconfig/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-osconfig/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-osconfig/.gitattributes b/packages/google-cloud-osconfig/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-osconfig/.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-osconfig/.gitignore b/packages/google-cloud-osconfig/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-osconfig/.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-osconfig/.jsdoc.js b/packages/google-cloud-osconfig/.jsdoc.js new file mode 100644 index 00000000000..a78d650c774 --- /dev/null +++ b/packages/google-cloud-osconfig/.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/os-config', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-osconfig/.mocharc.js b/packages/google-cloud-osconfig/.mocharc.js new file mode 100644 index 00000000000..cdb7b752160 --- /dev/null +++ b/packages/google-cloud-osconfig/.mocharc.js @@ -0,0 +1,29 @@ +// 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. +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-osconfig/.nycrc b/packages/google-cloud-osconfig/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-osconfig/.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-osconfig/.prettierignore b/packages/google-cloud-osconfig/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-osconfig/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-osconfig/.prettierrc.js b/packages/google-cloud-osconfig/.prettierrc.js new file mode 100644 index 00000000000..d546a4ad546 --- /dev/null +++ b/packages/google-cloud-osconfig/.prettierrc.js @@ -0,0 +1,17 @@ +// 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-osconfig/.repo-metadata.json b/packages/google-cloud-osconfig/.repo-metadata.json new file mode 100644 index 00000000000..c40476e0724 --- /dev/null +++ b/packages/google-cloud-osconfig/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "language": "nodejs", + "product_documentation": "https://cloud.google.com/compute/docs/os-patch-management", + "repo": "googleapis/google-cloud-node", + "repo_short": "nodejs-os-config", + "default_version": "v1", + "api_description": "provides OS management tools that can be used for patch management, patch compliance, and configuration management on VM instances.", + "name_pretty": "OS Config API", + "release_level": "stable", + "distribution_name": "@google-cloud/os-config", + "name": "osconfig", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/os-config/latest", + "api_id": "osconfig.googleapis.com", + "api_shortname": "osconfig", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-osconfig/CHANGELOG.md b/packages/google-cloud-osconfig/CHANGELOG.md new file mode 100644 index 00000000000..c0ee91ce54d --- /dev/null +++ b/packages/google-cloud-osconfig/CHANGELOG.md @@ -0,0 +1,230 @@ +# Changelog + +## [2.1.2](https://github.com/googleapis/nodejs-os-config/compare/v2.1.1...v2.1.2) (2022-11-11) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#220](https://github.com/googleapis/nodejs-os-config/issues/220)) ([13ef9fc](https://github.com/googleapis/nodejs-os-config/commit/13ef9fc7804fe21d200d3053196371f5a621c18a)) +* **deps:** Use google-gax v3.5.2 ([#228](https://github.com/googleapis/nodejs-os-config/issues/228)) ([c02bb82](https://github.com/googleapis/nodejs-os-config/commit/c02bb8288378280736343c0022ec8c7693285738)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-os-config/issues/1553)) ([#219](https://github.com/googleapis/nodejs-os-config/issues/219)) ([7c06e21](https://github.com/googleapis/nodejs-os-config/commit/7c06e2122f41f730d746c68b5ddaa2e93e5972dd)) +* Preserve default values in x-goog-request-params header ([#222](https://github.com/googleapis/nodejs-os-config/issues/222)) ([19a88d1](https://github.com/googleapis/nodejs-os-config/commit/19a88d1d760b3235df81afe04d0de9ead31b55d1)) +* Regenerated protos JS and TS definitions ([#231](https://github.com/googleapis/nodejs-os-config/issues/231)) ([9c1c5ee](https://github.com/googleapis/nodejs-os-config/commit/9c1c5ee464ca93f974e88d52cd8045cfd54b6872)) +* use google-gax v3.3.0 ([7c06e21](https://github.com/googleapis/nodejs-os-config/commit/7c06e2122f41f730d746c68b5ddaa2e93e5972dd)) + +## [2.1.1](https://github.com/googleapis/nodejs-os-config/compare/v2.1.0...v2.1.1) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#215](https://github.com/googleapis/nodejs-os-config/issues/215)) ([6460d25](https://github.com/googleapis/nodejs-os-config/commit/6460d2540ee1c65230c5bfefac19d5f60e57dd35)) +* change import long to require ([#216](https://github.com/googleapis/nodejs-os-config/issues/216)) ([4a53d92](https://github.com/googleapis/nodejs-os-config/commit/4a53d9258f285f29b7fe47659d76368f7f116b35)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-os-config/issues/1546)) ([#218](https://github.com/googleapis/nodejs-os-config/issues/218)) ([60e2d27](https://github.com/googleapis/nodejs-os-config/commit/60e2d273dcff7b2d88db8b4689524341e138edd3)) + +## [2.1.0](https://github.com/googleapis/nodejs-os-config/compare/v2.0.0...v2.1.0) (2022-07-02) + + +### Features + +* REGAPIC LRO; fix: make some camelcased methods work ([#211](https://github.com/googleapis/nodejs-os-config/issues/211)) ([af5d7d2](https://github.com/googleapis/nodejs-os-config/commit/af5d7d2c688c081a028c33f14490271ce2e52725)) + +## [2.0.0](https://github.com/googleapis/nodejs-os-config/compare/v1.12.1...v2.0.0) (2022-05-20) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#204) + +### Build System + +* update library to use Node 12 ([#204](https://github.com/googleapis/nodejs-os-config/issues/204)) ([39b393c](https://github.com/googleapis/nodejs-os-config/commit/39b393c6031079fba097b38458be6db8625515c5)) + +### [1.12.1](https://github.com/googleapis/nodejs-os-config/compare/v1.12.0...v1.12.1) (2022-02-11) + + +### Bug Fixes + +* update third_party protos to the most actual version: ([#186](https://github.com/googleapis/nodejs-os-config/issues/186)) ([9aceeab](https://github.com/googleapis/nodejs-os-config/commit/9aceeab92c12856e88cb7e59db29ee41cfba5465)) + +## [1.12.0](https://github.com/googleapis/nodejs-os-config/compare/v1.11.0...v1.12.0) (2022-02-08) + + +### Features + +* Update osconfig v1 protos ([#183](https://github.com/googleapis/nodejs-os-config/issues/183)) ([8ce2c5a](https://github.com/googleapis/nodejs-os-config/commit/8ce2c5ab9cfe2d4d0e12a574135b737279b86b22)) + +## [1.11.0](https://www.github.com/googleapis/nodejs-os-config/compare/v1.10.0...v1.11.0) (2021-11-12) + + +### Features + +* Update OSConfig API ([#164](https://www.github.com/googleapis/nodejs-os-config/issues/164)) ([19e820a](https://www.github.com/googleapis/nodejs-os-config/commit/19e820a362341b10225562bf76dc0f34e3e3fcae)) + +## [1.10.0](https://www.github.com/googleapis/nodejs-os-config/compare/v1.9.1...v1.10.0) (2021-10-20) + + +### Features + +* Update osconfig v1 and v1alpha RecurringSchedule.Frequency with DAILY frequency ([0a79eba](https://www.github.com/googleapis/nodejs-os-config/commit/0a79eba9f2a3e0939a74c9aa437b8890801ebd2a)) + +### [1.9.1](https://www.github.com/googleapis/nodejs-os-config/compare/v1.9.0...v1.9.1) (2021-09-09) + + +### Bug Fixes + +* **build:** switch primary branch to main ([#146](https://www.github.com/googleapis/nodejs-os-config/issues/146)) ([3947132](https://www.github.com/googleapis/nodejs-os-config/commit/39471322fa54f12943ff74e4ff4548034a99c5e6)) + +## [1.9.0](https://www.github.com/googleapis/nodejs-os-config/compare/v1.8.0...v1.9.0) (2021-09-07) + + +### Features + +* add OSConfigZonalService API Committer: [@jaiminsh](https://www.github.com/jaiminsh) ([#144](https://www.github.com/googleapis/nodejs-os-config/issues/144)) ([317a7a2](https://www.github.com/googleapis/nodejs-os-config/commit/317a7a2c3ea899b28fd0a5f2f4abe18524df1f7a)) + +## [1.8.0](https://www.github.com/googleapis/nodejs-os-config/compare/v1.7.0...v1.8.0) (2021-08-30) + + +### Features + +* Update osconfig v1 and v1alpha with WindowsApplication ([#142](https://www.github.com/googleapis/nodejs-os-config/issues/142)) ([6ad0c6d](https://www.github.com/googleapis/nodejs-os-config/commit/6ad0c6d547891986e3080fbcfc73ee64f7a31681)) + +## [1.7.0](https://www.github.com/googleapis/nodejs-os-config/compare/v1.6.6...v1.7.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#138](https://www.github.com/googleapis/nodejs-os-config/issues/138)) ([321fc5d](https://www.github.com/googleapis/nodejs-os-config/commit/321fc5d9088ad878d5343735659fc2884a76136a)) + +### [1.6.6](https://www.github.com/googleapis/nodejs-os-config/compare/v1.6.5...v1.6.6) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#136](https://www.github.com/googleapis/nodejs-os-config/issues/136)) ([d2f27b5](https://www.github.com/googleapis/nodejs-os-config/commit/d2f27b551e224cfcf5bc43dd8604dd1f2aa59fe9)) + +### [1.6.5](https://www.github.com/googleapis/nodejs-os-config/compare/v1.6.4...v1.6.5) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#128](https://www.github.com/googleapis/nodejs-os-config/issues/128)) ([4d7deda](https://www.github.com/googleapis/nodejs-os-config/commit/4d7deda72a06ecdfa2e88a9c2373fb3ec6365b77)) + +### [1.6.4](https://www.github.com/googleapis/nodejs-os-config/compare/v1.6.3...v1.6.4) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#126](https://www.github.com/googleapis/nodejs-os-config/issues/126)) ([a2744c6](https://www.github.com/googleapis/nodejs-os-config/commit/a2744c63a4d39a76e33f8a99d92c4027f25fc3a7)) + +### [1.6.3](https://www.github.com/googleapis/nodejs-os-config/compare/v1.6.2...v1.6.3) (2021-07-01) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#123](https://www.github.com/googleapis/nodejs-os-config/issues/123)) ([29f562b](https://www.github.com/googleapis/nodejs-os-config/commit/29f562b5f3489e2bfd2d2ae797d3f0212375fe01)) + +### [1.6.2](https://www.github.com/googleapis/nodejs-os-config/compare/v1.6.1...v1.6.2) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#117](https://www.github.com/googleapis/nodejs-os-config/issues/117)) ([4d1bbb8](https://www.github.com/googleapis/nodejs-os-config/commit/4d1bbb8593c3ca0ea0f6e8af1737b7106239617b)) + +### [1.6.1](https://www.github.com/googleapis/nodejs-os-config/compare/v1.6.0...v1.6.1) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#108](https://www.github.com/googleapis/nodejs-os-config/issues/108)) ([3d61a36](https://www.github.com/googleapis/nodejs-os-config/commit/3d61a36652465fa948595a18a99e0ebb3ecd0eac)) + +## [1.6.0](https://www.github.com/googleapis/nodejs-os-config/compare/v1.5.0...v1.6.0) (2021-05-24) + + +### Features + +* OSConfig: add ExecResourceOutput and per step error message. ([#105](https://www.github.com/googleapis/nodejs-os-config/issues/105)) ([3d9dbe9](https://www.github.com/googleapis/nodejs-os-config/commit/3d9dbe9f619798e691df9e04a65f8e42a2c2b0bc)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-os-config/compare/v1.4.0...v1.5.0) (2021-05-12) + + +### Features + +* add OSConfig v1alpha api ([#100](https://www.github.com/googleapis/nodejs-os-config/issues/100)) ([aa51617](https://www.github.com/googleapis/nodejs-os-config/commit/aa51617e8d473a1b2b08f878d3c9609b58274341)) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#95](https://www.github.com/googleapis/nodejs-os-config/issues/95)) ([1aae782](https://www.github.com/googleapis/nodejs-os-config/commit/1aae7821fe5d4606da2e04c05e383b43b698067e)) +* use require() to load JSON protos ([#98](https://www.github.com/googleapis/nodejs-os-config/issues/98)) ([d9e466b](https://www.github.com/googleapis/nodejs-os-config/commit/d9e466b9e54bd6ec667a0dfd324a47ec5593d7e1)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-os-config/compare/v1.3.1...v1.4.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#75](https://www.github.com/googleapis/nodejs-os-config/issues/75)) ([797ad14](https://www.github.com/googleapis/nodejs-os-config/commit/797ad14b56e331d5926ca7d952583b4094217ccc)) + +### [1.3.1](https://www.github.com/googleapis/nodejs-os-config/compare/v1.3.0...v1.3.1) (2020-11-25) + + +### Bug Fixes + +* check for fetch on window ([#69](https://www.github.com/googleapis/nodejs-os-config/issues/69)) ([02a5374](https://www.github.com/googleapis/nodejs-os-config/commit/02a53747e1b52d4a5d05714d8868ceee2c9eabb1)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-os-config/compare/v1.2.3...v1.3.0) (2020-11-12) + + +### Features + +* Added PatchRollout feature to PatchDeployments inventory proto definitions for VM Manager Inventory ([#62](https://www.github.com/googleapis/nodejs-os-config/issues/62)) ([7c4e2a1](https://www.github.com/googleapis/nodejs-os-config/commit/7c4e2a171346cb5f5ad5068c25b4c982450585c3)) + +### [1.2.3](https://www.github.com/googleapis/nodejs-os-config/compare/v1.2.2...v1.2.3) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#59](https://www.github.com/googleapis/nodejs-os-config/issues/59)) ([c6409f8](https://www.github.com/googleapis/nodejs-os-config/commit/c6409f8f5eae987853369a4206671b353d1da983)) + +### [1.2.2](https://www.github.com/googleapis/nodejs-os-config/compare/v1.2.1...v1.2.2) (2020-07-29) + + +### Bug Fixes + +* move gitattributes files to node templates ([#34](https://www.github.com/googleapis/nodejs-os-config/issues/34)) ([6d2276d](https://www.github.com/googleapis/nodejs-os-config/commit/6d2276d2b7b55672b61385b998bb490baf59bbbc)) + +### [1.2.1](https://www.github.com/googleapis/nodejs-os-config/compare/v1.2.0...v1.2.1) (2020-06-18) + + +### Bug Fixes + +* update node issue template ([#18](https://www.github.com/googleapis/nodejs-os-config/issues/18)) ([3d03605](https://www.github.com/googleapis/nodejs-os-config/commit/3d0360512d98ecdc11fd0267a0d4bfed5bc52900)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-os-config/compare/v1.1.0...v1.2.0) (2020-06-16) + + +### Features + +* promote library to GA ([#16](https://www.github.com/googleapis/nodejs-os-config/issues/16)) ([04b3c63](https://www.github.com/googleapis/nodejs-os-config/commit/04b3c63d188e2b8da10594bae80b4e47b7a89390)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-os-config/compare/v1.0.0...v1.1.0) (2020-06-15) + + +### Features + +* move ts target to es2018 from es2016 ([#11](https://www.github.com/googleapis/nodejs-os-config/issues/11)) ([eec48b0](https://www.github.com/googleapis/nodejs-os-config/commit/eec48b072d3eeb802b0736494ffba6f39d23ae19)) + + +### Bug Fixes + +* proper fallback option handling ([40f5d76](https://www.github.com/googleapis/nodejs-os-config/commit/40f5d76a8401f5a534e17fe7d5613fc839671383)) + +## 1.0.0 (2020-05-12) + + +### ⚠ BREAKING CHANGES + +* initial generation of library (#1) + +### Features + +* initial generation of library ([#1](https://www.github.com/googleapis/nodejs-os-config/issues/1)) ([b526b74](https://www.github.com/googleapis/nodejs-os-config/commit/b526b74051bd6dc093f3afb4dc2692cbb6bd8c3a)) diff --git a/packages/google-cloud-osconfig/CODE_OF_CONDUCT.md b/packages/google-cloud-osconfig/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-osconfig/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-osconfig/CONTRIBUTING.md b/packages/google-cloud-osconfig/CONTRIBUTING.md new file mode 100644 index 00000000000..34c1ac3fb2a --- /dev/null +++ b/packages/google-cloud-osconfig/CONTRIBUTING.md @@ -0,0 +1,75 @@ +# 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 the OS Config API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=osconfig.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-osconfig/LICENSE b/packages/google-cloud-osconfig/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-osconfig/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-osconfig/README.md b/packages/google-cloud-osconfig/README.md new file mode 100644 index 00000000000..d2395620e8e --- /dev/null +++ b/packages/google-cloud-osconfig/README.md @@ -0,0 +1,195 @@ +[//]: # "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 + +# [OS Config API: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![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/os-config.svg)](https://www.npmjs.org/package/@google-cloud/os-config) + + + + +Osconfig client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-osconfig/CHANGELOG.md). + +* [OS Config API Node.js Client API Reference][client-docs] +* [OS Config API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-osconfig](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-osconfig) + +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 the OS Config API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/os-config +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library +const {OsConfigServiceClient} = require('@google-cloud/os-config'); + +// Creates a client +const client = new OsConfigServiceClient(); + +// project = 'my-project' // Project to list deployments for. + +async function listPatchDeployments() { + const [deployments] = await client.listPatchDeployments({ + parent: `projects/${project}`, + }); + console.info(`found ${deployments.length} deployments:`); + console.info(deployments); +} +const listPatchDeploymentsResponse = listPatchDeployments(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Os_config_service.cancel_patch_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.cancel_patch_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.cancel_patch_job.js,samples/README.md) | +| Os_config_service.create_patch_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.create_patch_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.create_patch_deployment.js,samples/README.md) | +| Os_config_service.delete_patch_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.delete_patch_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.delete_patch_deployment.js,samples/README.md) | +| Os_config_service.execute_patch_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.execute_patch_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.execute_patch_job.js,samples/README.md) | +| Os_config_service.get_patch_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_deployment.js,samples/README.md) | +| Os_config_service.get_patch_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_job.js,samples/README.md) | +| Os_config_service.list_patch_deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_deployments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_deployments.js,samples/README.md) | +| Os_config_service.list_patch_job_instance_details | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_job_instance_details.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_job_instance_details.js,samples/README.md) | +| Os_config_service.list_patch_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_jobs.js,samples/README.md) | +| Os_config_service.pause_patch_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.pause_patch_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.pause_patch_deployment.js,samples/README.md) | +| Os_config_service.resume_patch_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.resume_patch_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.resume_patch_deployment.js,samples/README.md) | +| Os_config_service.update_patch_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.update_patch_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.update_patch_deployment.js,samples/README.md) | +| Os_config_zonal_service.create_o_s_policy_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.create_o_s_policy_assignment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.create_o_s_policy_assignment.js,samples/README.md) | +| Os_config_zonal_service.delete_o_s_policy_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.delete_o_s_policy_assignment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.delete_o_s_policy_assignment.js,samples/README.md) | +| Os_config_zonal_service.get_inventory | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_inventory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_inventory.js,samples/README.md) | +| Os_config_zonal_service.get_o_s_policy_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment.js,samples/README.md) | +| Os_config_zonal_service.get_o_s_policy_assignment_report | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment_report.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment_report.js,samples/README.md) | +| Os_config_zonal_service.get_vulnerability_report | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_vulnerability_report.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_vulnerability_report.js,samples/README.md) | +| Os_config_zonal_service.list_inventories | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_inventories.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_inventories.js,samples/README.md) | +| Os_config_zonal_service.list_o_s_policy_assignment_reports | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_reports.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_reports.js,samples/README.md) | +| Os_config_zonal_service.list_o_s_policy_assignment_revisions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_revisions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_revisions.js,samples/README.md) | +| Os_config_zonal_service.list_o_s_policy_assignments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignments.js,samples/README.md) | +| Os_config_zonal_service.list_vulnerability_reports | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_vulnerability_reports.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_vulnerability_reports.js,samples/README.md) | +| Os_config_zonal_service.update_o_s_policy_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.update_o_s_policy_assignment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.update_o_s_policy_assignment.js,samples/README.md) | +| Os_config_zonal_service.create_o_s_policy_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.create_o_s_policy_assignment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.create_o_s_policy_assignment.js,samples/README.md) | +| Os_config_zonal_service.delete_o_s_policy_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.delete_o_s_policy_assignment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.delete_o_s_policy_assignment.js,samples/README.md) | +| Os_config_zonal_service.get_instance_o_s_policies_compliance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_instance_o_s_policies_compliance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_instance_o_s_policies_compliance.js,samples/README.md) | +| Os_config_zonal_service.get_inventory | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_inventory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_inventory.js,samples/README.md) | +| Os_config_zonal_service.get_o_s_policy_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment.js,samples/README.md) | +| Os_config_zonal_service.get_o_s_policy_assignment_report | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment_report.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment_report.js,samples/README.md) | +| Os_config_zonal_service.get_vulnerability_report | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_vulnerability_report.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_vulnerability_report.js,samples/README.md) | +| Os_config_zonal_service.list_instance_o_s_policies_compliances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_instance_o_s_policies_compliances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_instance_o_s_policies_compliances.js,samples/README.md) | +| Os_config_zonal_service.list_inventories | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_inventories.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_inventories.js,samples/README.md) | +| Os_config_zonal_service.list_o_s_policy_assignment_reports | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_reports.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_reports.js,samples/README.md) | +| Os_config_zonal_service.list_o_s_policy_assignment_revisions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_revisions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_revisions.js,samples/README.md) | +| Os_config_zonal_service.list_o_s_policy_assignments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignments.js,samples/README.md) | +| Os_config_zonal_service.list_vulnerability_reports | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_vulnerability_reports.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_vulnerability_reports.js,samples/README.md) | +| Os_config_zonal_service.update_o_s_policy_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.update_o_s_policy_assignment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.update_o_s_policy_assignment.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/quickstart.js,samples/README.md) | +| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/test/quickstart.test.js,samples/README.md) | + + + +The [OS Config API Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://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/os-config@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/os-config/latest +[product-docs]: https://cloud.google.com/compute/docs/os-patch-management +[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=osconfig.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-osconfig/linkinator.config.json b/packages/google-cloud-osconfig/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-osconfig/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-osconfig/package.json b/packages/google-cloud-osconfig/package.json new file mode 100644 index 00000000000..ebb3e9a5ba2 --- /dev/null +++ b/packages/google-cloud-osconfig/package.json @@ -0,0 +1,57 @@ +{ + "name": "@google-cloud/os-config", + "version": "2.1.2", + "description": "Osconfig client for Node.js", + "repository": { + "type": "git", + "directory": "packages/google-cloud-osconfig", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "prefix": "cd samples; npm link ../; npm install", + "lint": "gts check", + "prelint": "cd samples; npm link ../; npm install", + "prepare": "npm run compile-protos && npm run compile", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.1.2", + "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": "^9.0.0", + "typescript": "^4.6.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-osconfig" +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/common_resources.proto b/packages/google-cloud-osconfig/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-cloud-osconfig/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-osconfig/protos/google/cloud/osconfig/v1/inventory.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/inventory.proto new file mode 100644 index 00000000000..92c2b81c832 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/inventory.proto @@ -0,0 +1,384 @@ +// 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "Inventories"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// OS Config Inventory is a service for collecting and reporting operating +// system and package information on VM instances. + +// This API resource represents the available inventory data for a +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// You can use this API resource to determine the inventory data of your VM. +// +// For more information, see [Information provided by OS inventory +// management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected). +message Inventory { + option (google.api.resource) = { + type: "osconfig.googleapis.com/Inventory" + pattern: "projects/{project}/locations/{location}/instances/{instance}/inventory" + }; + + // Operating system information for the VM. + message OsInfo { + // The VM hostname. + string hostname = 9; + + // The operating system long name. + // For example 'Debian GNU/Linux 9' or 'Microsoft Window Server 2019 + // Datacenter'. + string long_name = 2; + + // The operating system short name. + // For example, 'windows' or 'debian'. + string short_name = 3; + + // The version of the operating system. + string version = 4; + + // The system architecture of the operating system. + string architecture = 5; + + // The kernel version of the operating system. + string kernel_version = 6; + + // The kernel release of the operating system. + string kernel_release = 7; + + // The current version of the OS Config agent running on the VM. + string osconfig_agent_version = 8; + } + + // A single piece of inventory on a VM. + message Item { + // The origin of a specific inventory item. + enum OriginType { + // Invalid. An origin type must be specified. + ORIGIN_TYPE_UNSPECIFIED = 0; + + // This inventory item was discovered as the result of the agent + // reporting inventory via the reporting API. + INVENTORY_REPORT = 1; + } + + // The different types of inventory that are tracked on a VM. + enum Type { + // Invalid. An type must be specified. + TYPE_UNSPECIFIED = 0; + + // This represents a package that is installed on the VM. + INSTALLED_PACKAGE = 1; + + // This represents an update that is available for a package. + AVAILABLE_PACKAGE = 2; + } + + // Identifier for this item, unique across items for this VM. + string id = 1; + + // The origin of this inventory item. + OriginType origin_type = 2; + + // When this inventory item was first detected. + google.protobuf.Timestamp create_time = 8; + + // When this inventory item was last modified. + google.protobuf.Timestamp update_time = 9; + + // The specific type of inventory, correlating to its specific details. + Type type = 5; + + // Specific details of this inventory item based on its type. + oneof details { + // Software package present on the VM instance. + SoftwarePackage installed_package = 6; + + // Software package available to be installed on the VM instance. + SoftwarePackage available_package = 7; + } + } + + // Software package information of the operating system. + message SoftwarePackage { + // Information about the different types of software packages. + oneof details { + // Yum package info. + // For details about the yum package manager, see + // https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/ch-yum. + VersionedPackage yum_package = 1; + + // Details of an APT package. + // For details about the apt package manager, see + // https://wiki.debian.org/Apt. + VersionedPackage apt_package = 2; + + // Details of a Zypper package. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + VersionedPackage zypper_package = 3; + + // Details of a Googet package. + // For details about the googet package manager, see + // https://github.com/google/googet. + VersionedPackage googet_package = 4; + + // Details of a Zypper patch. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + ZypperPatch zypper_patch = 5; + + // Details of a Windows Update package. + // See https://docs.microsoft.com/en-us/windows/win32/api/_wua/ for + // information about Windows Update. + WindowsUpdatePackage wua_package = 6; + + // Details of a Windows Quick Fix engineering package. + // See + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + // for info in Windows Quick Fix Engineering. + WindowsQuickFixEngineeringPackage qfe_package = 7; + + // Details of a COS package. + VersionedPackage cos_package = 8; + + // Details of Windows Application. + WindowsApplication windows_application = 9; + } + } + + // Information related to the a standard versioned package. This includes + // package info for APT, Yum, Zypper, and Googet package managers. + message VersionedPackage { + // The name of the package. + string package_name = 4; + + // The system architecture this package is intended for. + string architecture = 2; + + // The version of the package. + string version = 3; + } + + // Details related to a Zypper Patch. + message ZypperPatch { + // The name of the patch. + string patch_name = 5; + + // The category of the patch. + string category = 2; + + // The severity specified for this patch + string severity = 3; + + // Any summary information provided about this patch. + string summary = 4; + } + + // Details related to a Windows Update package. + // Field data and names are taken from Windows Update API IUpdate Interface: + // https://docs.microsoft.com/en-us/windows/win32/api/_wua/ + // Descriptive fields like title, and description are localized based on + // the locale of the VM being updated. + message WindowsUpdatePackage { + // Categories specified by the Windows Update. + message WindowsUpdateCategory { + // The identifier of the windows update category. + string id = 1; + + // The name of the windows update category. + string name = 2; + } + + // The localized title of the update package. + string title = 1; + + // The localized description of the update package. + string description = 2; + + // The categories that are associated with this update package. + repeated WindowsUpdateCategory categories = 3; + + // A collection of Microsoft Knowledge Base article IDs that are associated + // with the update package. + repeated string kb_article_ids = 4; + + // A hyperlink to the language-specific support information for the update. + string support_url = 11; + + // A collection of URLs that provide more information about the update + // package. + repeated string more_info_urls = 5; + + // Gets the identifier of an update package. Stays the same across + // revisions. + string update_id = 6; + + // The revision number of this update package. + int32 revision_number = 7; + + // The last published date of the update, in (UTC) date and time. + google.protobuf.Timestamp last_deployment_change_time = 10; + } + + // Information related to a Quick Fix Engineering package. + // Fields are taken from Windows QuickFixEngineering Interface and match + // the source names: + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + message WindowsQuickFixEngineeringPackage { + // A short textual description of the QFE update. + string caption = 1; + + // A textual description of the QFE update. + string description = 2; + + // Unique identifier associated with a particular QFE update. + string hot_fix_id = 3; + + // Date that the QFE update was installed. Mapped from installed_on field. + google.protobuf.Timestamp install_time = 5; + } + + // Contains information about a Windows application that is retrieved from the + // Windows Registry. For more information about these fields, see: + // https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key + message WindowsApplication { + // The name of the application or product. + string display_name = 1; + + // The version of the product or application in string format. + string display_version = 2; + + // The name of the manufacturer for the product or application. + string publisher = 3; + + // The last time this product received service. The value of this property + // is replaced each time a patch is applied or removed from the product or + // the command-line option is used to repair the product. + google.type.Date install_date = 4; + + // The internet address for technical support. + string help_link = 5; + } + + // Output only. The `Inventory` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory` + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Base level operating system information for the VM. + OsInfo os_info = 1; + + // Inventory items related to the VM keyed by an opaque unique identifier for + // each inventory item. The identifier is unique to each distinct and + // addressable inventory item and will change, when there is a new package + // version. + map items = 2; + + // Output only. Timestamp of the last reported inventory for the VM. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting inventory data for the specified VM. +message GetInventoryRequest { + // Required. API resource name for inventory resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/inventory` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/Inventory" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; +} + +// A request message for listing inventory data for all VMs in the specified +// location. +message ListInventoriesRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; + + // The maximum number of results to return. + int32 page_size = 3; + + // A pagination token returned from a previous call to + // `ListInventories` that indicates where this listing + // should continue from. + string page_token = 4; + + // If provided, this field specifies the criteria that must be met by a + // `Inventory` API resource to be included in the response. + string filter = 5; +} + +// A response message for listing inventory data for all VMs in a specified +// location. +message ListInventoriesResponse { + // List of inventory objects. + repeated Inventory inventories = 1; + + // The pagination token to retrieve the next page of inventory objects. + string next_page_token = 2; +} + +// The view for inventory objects. +enum InventoryView { + // The default value. + // The API defaults to the BASIC view. + INVENTORY_VIEW_UNSPECIFIED = 0; + + // Returns the basic inventory information that includes `os_info`. + BASIC = 1; + + // Returns all fields. + FULL = 2; +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/os_policy.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/os_policy.proto new file mode 100644 index 00000000000..de0db191797 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/os_policy.proto @@ -0,0 +1,548 @@ +// 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.osconfig.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OsPolicyProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// An OS policy defines the desired state configuration for a VM. +message OSPolicy { + // Policy mode + enum Mode { + // Invalid mode + MODE_UNSPECIFIED = 0; + + // This mode checks if the configuration resources in the policy are in + // their desired state. No actions are performed if they are not in the + // desired state. This mode is used for reporting purposes. + VALIDATION = 1; + + // This mode checks if the configuration resources in the policy are in + // their desired state, and if not, enforces the desired state. + ENFORCEMENT = 2; + } + + // Filtering criteria to select VMs based on inventory details. + message InventoryFilter { + // Required. The OS short name + string os_short_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The OS version + // + // Prefix matches are supported if asterisk(*) is provided as the + // last character. For example, to match all versions with a major + // version of `7`, specify the following value for this field `7.*` + // + // An empty string matches all OS versions. + string os_version = 2; + } + + // An OS policy resource is used to define the desired state configuration + // and provides a specific functionality like installing/removing packages, + // executing a script etc. + // + // The system ensures that resources are always in their desired state by + // taking necessary actions if they have drifted from their desired state. + message Resource { + // A remote or local file. + message File { + // Specifies a file available via some URI. + message Remote { + // Required. URI from which to fetch the object. It should contain both + // the protocol and path following the format `{protocol}://{location}`. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // SHA256 checksum of the remote file. + string sha256_checksum = 2; + } + + // Specifies a file available as a Cloud Storage Object. + message Gcs { + // Required. Bucket of the Cloud Storage object. + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the Cloud Storage object. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Generation number of the Cloud Storage object. + int64 generation = 3; + } + + // A specific type of file. + oneof type { + // A generic remote file. + Remote remote = 1; + + // A Cloud Storage object. + Gcs gcs = 2; + + // A local path within the VM to use. + string local_path = 3; + } + + // Defaults to false. When false, files are subject to validations + // based on the file type: + // + // Remote: A checksum must be specified. + // Cloud Storage: An object generation number must be specified. + bool allow_insecure = 4; + } + + // A resource that manages a system package. + message PackageResource { + // The desired state that the OS Config agent maintains on the VM. + enum DesiredState { + // Unspecified is invalid. + DESIRED_STATE_UNSPECIFIED = 0; + + // Ensure that the package is installed. + INSTALLED = 1; + + // The agent ensures that the package is not installed and + // uninstalls it if detected. + REMOVED = 2; + } + + // A deb package file. dpkg packages only support INSTALLED state. + message Deb { + // Required. A deb package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether dependencies should also be installed. + // - install when false: `dpkg -i package` + // - install when true: `apt-get update && apt-get -y install + // package.deb` + bool pull_deps = 2; + } + + // A package managed by APT. + // - install: `apt-get update && apt-get -y install [name]` + // - remove: `apt-get -y remove [name]` + message APT { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // An RPM package file. RPM packages only support INSTALLED state. + message RPM { + // Required. An rpm package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether dependencies should also be installed. + // - install when false: `rpm --upgrade --replacepkgs package.rpm` + // - install when true: `yum -y install package.rpm` or + // `zypper -y install package.rpm` + bool pull_deps = 2; + } + + // A package managed by YUM. + // - install: `yum -y install package` + // - remove: `yum -y remove package` + message YUM { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A package managed by Zypper. + // - install: `zypper -y install package` + // - remove: `zypper -y rm package` + message Zypper { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A package managed by GooGet. + // - install: `googet -noconfirm install package` + // - remove: `googet -noconfirm remove package` + message GooGet { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // An MSI package. MSI packages only support INSTALLED state. + message MSI { + // Required. The MSI package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Additional properties to use during installation. + // This should be in the format of Property=Setting. + // Appended to the defaults of `ACTION=INSTALL + // REBOOT=ReallySuppress`. + repeated string properties = 2; + } + + // Required. The desired state the agent should maintain for this package. + DesiredState desired_state = 1 [(google.api.field_behavior) = REQUIRED]; + + // A system package. + oneof system_package { + // A package managed by Apt. + APT apt = 2; + + // A deb package file. + Deb deb = 3; + + // A package managed by YUM. + YUM yum = 4; + + // A package managed by Zypper. + Zypper zypper = 5; + + // An rpm package file. + RPM rpm = 6; + + // A package managed by GooGet. + GooGet googet = 7; + + // An MSI package. + MSI msi = 8; + } + } + + // A resource that manages a package repository. + message RepositoryResource { + // Represents a single apt package repository. These will be added to + // a repo file that will be managed at + // `/etc/apt/sources.list.d/google_osconfig.list`. + message AptRepository { + // Type of archive. + enum ArchiveType { + // Unspecified is invalid. + ARCHIVE_TYPE_UNSPECIFIED = 0; + + // Deb indicates that the archive contains binary files. + DEB = 1; + + // Deb-src indicates that the archive contains source files. + DEB_SRC = 2; + } + + // Required. Type of archive files in this repository. + ArchiveType archive_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. URI for this repository. + string uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Distribution of this repository. + string distribution = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of components for this repository. Must contain at + // least one item. + repeated string components = 4 [(google.api.field_behavior) = REQUIRED]; + + // URI of the key file for this repository. The agent maintains a + // keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg`. + string gpg_key = 5; + } + + // Represents a single yum package repository. These are added to a + // repo file that is managed at + // `/etc/yum.repos.d/google_osconfig.repo`. + message YumRepository { + // Required. A one word, unique name for this repository. This is the + // `repo id` in the yum config file and also the `display_name` if + // `display_name` is omitted. This id is also used as the unique + // identifier when checking for resource conflicts. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the repository. + string display_name = 2; + + // Required. The location of the repository directory. + string base_url = 3 [(google.api.field_behavior) = REQUIRED]; + + // URIs of GPG keys. + repeated string gpg_keys = 4; + } + + // Represents a single zypper package repository. These are added to a + // repo file that is managed at + // `/etc/zypp/repos.d/google_osconfig.repo`. + message ZypperRepository { + // Required. A one word, unique name for this repository. This is the + // `repo id` in the zypper config file and also the `display_name` if + // `display_name` is omitted. This id is also used as the unique + // identifier when checking for GuestPolicy conflicts. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the repository. + string display_name = 2; + + // Required. The location of the repository directory. + string base_url = 3 [(google.api.field_behavior) = REQUIRED]; + + // URIs of GPG keys. + repeated string gpg_keys = 4; + } + + // Represents a Goo package repository. These are added to a repo file + // that is managed at + // `C:/ProgramData/GooGet/repos/google_osconfig.repo`. + message GooRepository { + // Required. The name of the repository. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The url of the repository. + string url = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // A specific type of repository. + oneof repository { + // An Apt Repository. + AptRepository apt = 1; + + // A Yum Repository. + YumRepository yum = 2; + + // A Zypper Repository. + ZypperRepository zypper = 3; + + // A Goo Repository. + GooRepository goo = 4; + } + } + + // A resource that allows executing scripts on the VM. + // + // The `ExecResource` has 2 stages: `validate` and `enforce` and both stages + // accept a script as an argument to execute. + // + // When the `ExecResource` is applied by the agent, it first executes the + // script in the `validate` stage. The `validate` stage can signal that the + // `ExecResource` is already in the desired state by returning an exit code + // of `100`. If the `ExecResource` is not in the desired state, it should + // return an exit code of `101`. Any other exit code returned by this stage + // is considered an error. + // + // If the `ExecResource` is not in the desired state based on the exit code + // from the `validate` stage, the agent proceeds to execute the script from + // the `enforce` stage. If the `ExecResource` is already in the desired + // state, the `enforce` stage will not be run. + // Similar to `validate` stage, the `enforce` stage should return an exit + // code of `100` to indicate that the resource in now in its desired state. + // Any other exit code is considered an error. + // + // NOTE: An exit code of `100` was chosen over `0` (and `101` vs `1`) to + // have an explicit indicator of `in desired state`, `not in desired state` + // and errors. Because, for example, Powershell will always return an exit + // code of `0` unless an `exit` statement is provided in the script. So, for + // reasons of consistency and being explicit, exit codes `100` and `101` + // were chosen. + message ExecResource { + // A file or script to execute. + message Exec { + // The interpreter to use. + enum Interpreter { + // Invalid value, the request will return validation error. + INTERPRETER_UNSPECIFIED = 0; + + // If an interpreter is not specified, the + // source is executed directly. This execution, without an + // interpreter, only succeeds for executables and scripts that have shebang lines. + NONE = 1; + + // Indicates that the script runs with `/bin/sh` on Linux and + // `cmd.exe` on Windows. + SHELL = 2; + + // Indicates that the script runs with PowerShell. + POWERSHELL = 3; + } + + // What to execute. + oneof source { + // A remote or local file. + File file = 1; + + // An inline script. + // The size of the script is limited to 1024 characters. + string script = 2; + } + + // Optional arguments to pass to the source during execution. + repeated string args = 3; + + // Required. The script interpreter to use. + Interpreter interpreter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Only recorded for enforce Exec. + // Path to an output file (that is created by this Exec) whose + // content will be recorded in OSPolicyResourceCompliance after a + // successful run. Absence or failure to read this file will result in + // this ExecResource being non-compliant. Output file size is limited to + // 100K bytes. + string output_file_path = 5; + } + + // Required. What to run to validate this resource is in the desired + // state. An exit code of 100 indicates "in desired state", and exit code + // of 101 indicates "not in desired state". Any other exit code indicates + // a failure running validate. + Exec validate = 1 [(google.api.field_behavior) = REQUIRED]; + + // What to run to bring this resource into the desired state. + // An exit code of 100 indicates "success", any other exit code indicates + // a failure running enforce. + Exec enforce = 2; + } + + // A resource that manages the state of a file. + message FileResource { + // Desired state of the file. + enum DesiredState { + // Unspecified is invalid. + DESIRED_STATE_UNSPECIFIED = 0; + + // Ensure file at path is present. + PRESENT = 1; + + // Ensure file at path is absent. + ABSENT = 2; + + // Ensure the contents of the file at path matches. If the file does + // not exist it will be created. + CONTENTS_MATCH = 3; + } + + // The source for the contents of the file. + oneof source { + // A remote or local source. + File file = 1; + + // A a file with this content. + // The size of the content is limited to 1024 characters. + string content = 2; + } + + // Required. The absolute path of the file within the VM. + string path = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Desired state of the file. + DesiredState state = 4 [(google.api.field_behavior) = REQUIRED]; + + // Consists of three octal digits which represent, in + // order, the permissions of the owner, group, and other users for the + // file (similarly to the numeric mode used in the linux chmod + // utility). Each digit represents a three bit number with the 4 bit + // corresponding to the read permissions, the 2 bit corresponds to the + // write bit, and the one bit corresponds to the execute permission. + // Default behavior is 755. + // + // Below are some examples of permissions and their associated values: + // read, write, and execute: 7 + // read and execute: 5 + // read and write: 6 + // read only: 4 + string permissions = 5; + } + + // Required. The id of the resource with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the OS policy. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Resource type. + oneof resource_type { + // Package resource + PackageResource pkg = 2; + + // Package repository resource + RepositoryResource repository = 3; + + // Exec resource + ExecResource exec = 4; + + // File resource + FileResource file = 5; + } + } + + // Resource groups provide a mechanism to group OS policy resources. + // + // Resource groups enable OS policy authors to create a single OS policy + // to be applied to VMs running different operating Systems. + // + // When the OS policy is applied to a target VM, the appropriate resource + // group within the OS policy is selected based on the `OSFilter` specified + // within the resource group. + message ResourceGroup { + // List of inventory filters for the resource group. + // + // The resources in this resource group are applied to the target VM if it + // satisfies at least one of the following inventory filters. + // + // For example, to apply this resource group to VMs running either `RHEL` or + // `CentOS` operating systems, specify 2 items for the list with following + // values: + // inventory_filters[0].os_short_name='rhel' and + // inventory_filters[1].os_short_name='centos' + // + // If the list is empty, this resource group will be applied to the target + // VM unconditionally. + repeated InventoryFilter inventory_filters = 1; + + // Required. List of resources configured for this resource group. + // The resources are executed in the exact order specified here. + repeated Resource resources = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The id of the OS policy with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the assignment. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Policy description. + // Length of the description is limited to 1024 characters. + string description = 2; + + // Required. Policy mode + Mode mode = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of resource groups for the policy. + // For a particular VM, resource groups are evaluated in the order specified + // and the first resource group that is applicable is selected and the rest + // are ignored. + // + // If none of the resource groups are applicable for a VM, the VM is + // considered to be non-compliant w.r.t this policy. This behavior can be + // toggled by the flag `allow_no_resource_group_match` + repeated ResourceGroup resource_groups = 4 + [(google.api.field_behavior) = REQUIRED]; + + // This flag determines the OS policy compliance status when none of the + // resource groups within the policy are applicable for a VM. Set this value + // to `true` if the policy needs to be reported as compliant even if the + // policy has nothing to validate or enforce. + bool allow_no_resource_group_match = 5; +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto new file mode 100644 index 00000000000..aa4b2b11b4e --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto @@ -0,0 +1,296 @@ +// 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OSPolicyAssignmentReportsProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; +option (google.api.resource_definition) = { + type: "osconfig.googleapis.com/InstanceOSPolicyAssignment" + pattern: "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}" +}; + +// Get a report of the OS policy assignment for a VM instance. +message GetOSPolicyAssignmentReportRequest { + // Required. API resource name for OS policy assignment report. + // + // Format: + // `/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance_id}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + // For `{assignment_id}`, the OSPolicyAssignment id must be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignmentReport" + } + ]; +} + +// List the OS policy assignment reports for VM instances. +message ListOSPolicyAssignmentReportsRequest { + // Required. The parent resource name. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + // provided. If '-' is provided, the response will include + // OSPolicyAssignmentReports for all instances in the project/location. + // For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + // is provided, the response will include OSPolicyAssignmentReports for all + // OSPolicyAssignments in the project/location. + // Either {instance} or {assignment} must be `-`. + // + // For example: + // `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + // returns all reports for the instance + // `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + // returns all the reports for the given assignment across all instances. + // `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + // returns all the reports for all assignments across all instances. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/InstanceOSPolicyAssignment" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // If provided, this field specifies the criteria that must be met by the + // `OSPolicyAssignmentReport` API resource that is included in the response. + string filter = 3; + + // A pagination token returned from a previous call to the + // `ListOSPolicyAssignmentReports` method that indicates where this listing + // should continue from. + string page_token = 4; +} + +// A response message for listing OS Policy assignment reports including the +// page of results and page token. +message ListOSPolicyAssignmentReportsResponse { + // List of OS policy assignment reports. + repeated OSPolicyAssignmentReport os_policy_assignment_reports = 1; + + // The pagination token to retrieve the next page of OS policy assignment + // report objects. + string next_page_token = 2; +} + +// A report of the OS policy assignment status for a given instance. +message OSPolicyAssignmentReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/OSPolicyAssignmentReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report" + }; + + // Compliance data for an OS policy + message OSPolicyCompliance { + // Possible compliance states for an os policy. + enum ComplianceState { + // The policy is in an unknown compliance state. + // + // Refer to the field `compliance_state_reason` to learn the exact reason + // for the policy to be in this compliance state. + UNKNOWN = 0; + + // Policy is compliant. + // + // The policy is compliant if all the underlying resources are also + // compliant. + COMPLIANT = 1; + + // Policy is non-compliant. + // + // The policy is non-compliant if one or more underlying resources are + // non-compliant. + NON_COMPLIANT = 2; + } + + // Compliance data for an OS policy resource. + message OSPolicyResourceCompliance { + // Step performed by the OS Config agent for configuring an + // `OSPolicy` resource to its desired state. + message OSPolicyResourceConfigStep { + // Supported configuration step types + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // Checks for resource conflicts such as schema errors. + VALIDATION = 1; + + // Checks the current status of the desired state for a resource. + DESIRED_STATE_CHECK = 2; + + // Enforces the desired state for a resource that is not in desired + // state. + DESIRED_STATE_ENFORCEMENT = 3; + + // Re-checks the status of the desired state. This check is done + // for a resource after the enforcement of all OS policies. + // + // This step is used to determine the final desired state status for + // the resource. It accounts for any resources that might have drifted + // from their desired state due to side effects from executing other + // resources. + DESIRED_STATE_CHECK_POST_ENFORCEMENT = 4; + } + + // Configuration step type. + Type type = 1; + + // An error message recorded during the execution of this step. + // Only populated if errors were encountered during this step execution. + string error_message = 2; + } + + // Possible compliance states for a resource. + enum ComplianceState { + // The resource is in an unknown compliance state. + // + // To get more details about why the policy is in this state, review + // the output of the `compliance_state_reason` field. + UNKNOWN = 0; + + // Resource is compliant. + COMPLIANT = 1; + + // Resource is non-compliant. + NON_COMPLIANT = 2; + } + + // ExecResource specific output. + message ExecResourceOutput { + // Output from enforcement phase output file (if run). + // Output size is limited to 100K bytes. + bytes enforcement_output = 2; + } + + // The ID of the OS policy resource. + string os_policy_resource_id = 1; + + // Ordered list of configuration completed by the agent for the OS policy + // resource. + repeated OSPolicyResourceConfigStep config_steps = 2; + + // The compliance state of the resource. + ComplianceState compliance_state = 3; + + // A reason for the resource to be in the given compliance state. + // This field is always populated when `compliance_state` is `UNKNOWN`. + // + // The following values are supported when `compliance_state == UNKNOWN` + // + // * `execution-errors`: Errors were encountered by the agent while + // executing the resource and the compliance state couldn't be + // determined. + // * `execution-skipped-by-agent`: Resource execution was skipped by the + // agent because errors were encountered while executing prior resources + // in the OS policy. + // * `os-policy-execution-attempt-failed`: The execution of the OS policy + // containing this resource failed and the compliance state couldn't be + // determined. + string compliance_state_reason = 4; + + // Resource specific output. + oneof output { + // ExecResource specific output. + ExecResourceOutput exec_resource_output = 5; + } + } + + // The OS policy id + string os_policy_id = 1; + + // The compliance state of the OS policy. + ComplianceState compliance_state = 2; + + // The reason for the OS policy to be in an unknown compliance state. + // This field is always populated when `compliance_state` is `UNKNOWN`. + // + // If populated, the field can contain one of the following values: + // + // * `vm-not-running`: The VM was not running. + // * `os-policies-not-supported-by-agent`: The version of the OS Config + // agent running on the VM does not support running OS policies. + // * `no-agent-detected`: The OS Config agent is not detected for the VM. + // * `resource-execution-errors`: The OS Config agent encountered errors + // while executing one or more resources in the policy. See + // `os_policy_resource_compliances` for details. + // * `task-timeout`: The task sent to the agent to apply the policy timed + // out. + // * `unexpected-agent-state`: The OS Config agent did not report the final + // status of the task that attempted to apply the policy. Instead, the agent + // unexpectedly started working on a different task. This mostly happens + // when the agent or VM unexpectedly restarts while applying OS policies. + // * `internal-service-errors`: Internal service errors were encountered + // while attempting to apply the policy. + string compliance_state_reason = 3; + + // Compliance data for each resource within the policy that is applied to + // the VM. + repeated OSPolicyResourceCompliance os_policy_resource_compliances = 4; + } + + // The `OSPolicyAssignmentReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/osPolicyAssignments/{os_policy_assignment_id}/report` + string name = 1; + + // The Compute Engine VM instance name. + string instance = 2; + + // Reference to the `OSPolicyAssignment` API resource that the `OSPolicy` + // belongs to. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` + string os_policy_assignment = 3 [(google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + }]; + + // Compliance data for each `OSPolicy` that is applied to the VM. + repeated OSPolicyCompliance os_policy_compliances = 4; + + // Timestamp for when the report was last generated. + google.protobuf.Timestamp update_time = 5; + + // Unique identifier of the last attempted run to apply the OS policies + // associated with this assignment on the VM. + // + // This ID is logged by the OS Config agent while applying the OS + // policies associated with this assignment on the VM. + // NOTE: If the service is unable to successfully connect to the agent for + // this run, then this id will not be available in the agent logs. + string last_run_id = 6; +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/os_policy_assignments.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/os_policy_assignments.proto new file mode 100644 index 00000000000..157b8fd3989 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/os_policy_assignments.proto @@ -0,0 +1,386 @@ +// 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/os_policy.proto"; +import "google/cloud/osconfig/v1/osconfig_common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OsPolicyAssignmentsProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// OS policy assignment is an API resource that is used to +// apply a set of OS policies to a dynamically targeted group of Compute Engine +// VM instances. +// +// An OS policy is used to define the desired state configuration for a +// Compute Engine VM instance through a set of configuration resources that +// provide capabilities such as installing or removing software packages, or +// executing a script. +// +// For more information, see [OS policy and OS policy +// assignment](https://cloud.google.com/compute/docs/os-configuration-management/working-with-os-policies). +message OSPolicyAssignment { + option (google.api.resource) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + pattern: "projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}" + }; + + // Message representing label set. + // * A label is a key value pair set for a VM. + // * A LabelSet is a set of labels. + // * Labels within a LabelSet are ANDed. In other words, a LabelSet is + // applicable for a VM only if it matches all the labels in the + // LabelSet. + // * Example: A LabelSet with 2 labels: `env=prod` and `type=webserver` will + // only be applicable for those VMs with both labels + // present. + message LabelSet { + // Labels are identified by key/value pairs in this map. + // A VM should contain all the key/value pairs specified in this + // map to be selected. + map labels = 1; + } + + // Filters to select target VMs for an assignment. + // + // If more than one filter criteria is specified below, a VM will be selected + // if and only if it satisfies all of them. + message InstanceFilter { + // VM inventory details. + message Inventory { + // Required. The OS short name + string os_short_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The OS version + // + // Prefix matches are supported if asterisk(*) is provided as the + // last character. For example, to match all versions with a major + // version of `7`, specify the following value for this field `7.*` + // + // An empty string matches all OS versions. + string os_version = 2; + } + + // Target all VMs in the project. If true, no other criteria is + // permitted. + bool all = 1; + + // List of label sets used for VM inclusion. + // + // If the list has more than one `LabelSet`, the VM is included if any + // of the label sets are applicable for the VM. + repeated LabelSet inclusion_labels = 2; + + // List of label sets used for VM exclusion. + // + // If the list has more than one label set, the VM is excluded if any + // of the label sets are applicable for the VM. + repeated LabelSet exclusion_labels = 3; + + // List of inventories to select VMs. + // + // A VM is selected if its inventory data matches at least one of the + // following inventories. + repeated Inventory inventories = 4; + } + + // Message to configure the rollout at the zonal level for the OS policy + // assignment. + message Rollout { + // Required. The maximum number (or percentage) of VMs per zone to disrupt + // at any given moment. + FixedOrPercent disruption_budget = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. This determines the minimum duration of time to wait after the + // configuration changes are applied through the current rollout. A + // VM continues to count towards the `disruption_budget` at least + // until this duration of time has passed after configuration changes are + // applied. + google.protobuf.Duration min_wait_duration = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // OS policy assignment rollout state + enum RolloutState { + // Invalid value + ROLLOUT_STATE_UNSPECIFIED = 0; + + // The rollout is in progress. + IN_PROGRESS = 1; + + // The rollout is being cancelled. + CANCELLING = 2; + + // The rollout is cancelled. + CANCELLED = 3; + + // The rollout has completed successfully. + SUCCEEDED = 4; + } + + // Resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id}` + // + // This field is ignored when you create an OS policy assignment. + string name = 1; + + // OS policy assignment description. + // Length of the description is limited to 1024 characters. + string description = 2; + + // Required. List of OS policies to be applied to the VMs. + repeated OSPolicy os_policies = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Filter to select VMs. + InstanceFilter instance_filter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Rollout to deploy the OS policy assignment. + // A rollout is triggered in the following situations: + // 1) OSPolicyAssignment is created. + // 2) OSPolicyAssignment is updated and the update contains changes to one of + // the following fields: + // - instance_filter + // - os_policies + // 3) OSPolicyAssignment is deleted. + Rollout rollout = 5 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The assignment revision ID + // A new revision is committed whenever a rollout is triggered for a OS policy + // assignment + string revision_id = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp that the revision was created. + google.protobuf.Timestamp revision_create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The etag for this OS policy assignment. + // If this is provided on update, it must match the server's etag. + string etag = 8; + + // Output only. OS policy assignment rollout state + RolloutState rollout_state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that this revision has been successfully rolled out + // in this zone and new VMs will be assigned OS policies from this revision. + // + // For a given OS policy assignment, there is only one revision with a value + // of `true` for this field. + bool baseline = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that this revision deletes the OS policy assignment. + bool deleted = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that reconciliation is in progress for the revision. + // This value is `true` when the `rollout_state` is one of: + // * IN_PROGRESS + // * CANCELLING + bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server generated unique id for the OS policy assignment + // resource. + string uid = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// OS policy assignment operation metadata provided by OS policy assignment API +// methods that return long running operations. +message OSPolicyAssignmentOperationMetadata { + // The OS policy assignment API method. + enum APIMethod { + // Invalid value + API_METHOD_UNSPECIFIED = 0; + + // Create OS policy assignment API method + CREATE = 1; + + // Update OS policy assignment API method + UPDATE = 2; + + // Delete OS policy assignment API method + DELETE = 3; + } + + // State of the rollout + enum RolloutState { + // Invalid value + ROLLOUT_STATE_UNSPECIFIED = 0; + + // The rollout is in progress. + IN_PROGRESS = 1; + + // The rollout is being cancelled. + CANCELLING = 2; + + // The rollout is cancelled. + CANCELLED = 3; + + // The rollout has completed successfully. + SUCCEEDED = 4; + } + + // Reference to the `OSPolicyAssignment` API resource. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` + string os_policy_assignment = 1 [(google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + }]; + + // The OS policy assignment API method. + APIMethod api_method = 2; + + // State of the rollout + RolloutState rollout_state = 3; + + // Rollout start time + google.protobuf.Timestamp rollout_start_time = 4; + + // Rollout update time + google.protobuf.Timestamp rollout_update_time = 5; +} + +// A request message to create an OS policy assignment +message CreateOSPolicyAssignmentRequest { + // Required. The parent resource name in the form: + // projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The OS policy assignment to be created. + OSPolicyAssignment os_policy_assignment = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The logical name of the OS policy assignment in the project + // with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the project. + string os_policy_assignment_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A request message to update an OS policy assignment +message UpdateOSPolicyAssignmentRequest { + // Required. The updated OS policy assignment. + OSPolicyAssignment os_policy_assignment = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask that controls which fields of the assignment should be + // updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message to get an OS policy assignment +message GetOSPolicyAssignmentRequest { + // Required. The resource name of OS policy assignment. + // + // Format: + // `projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}@{revisionId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; +} + +// A request message to list OS policy assignments for a parent resource +message ListOSPolicyAssignmentsRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of assignments to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListOSPolicyAssignments` that indicates where this listing should continue + // from. + string page_token = 3; +} + +// A response message for listing all assignments under given parent. +message ListOSPolicyAssignmentsResponse { + // The list of assignments + repeated OSPolicyAssignment os_policy_assignments = 1; + + // The pagination token to retrieve the next page of OS policy assignments. + string next_page_token = 2; +} + +// A request message to list revisions for a OS policy assignment +message ListOSPolicyAssignmentRevisionsRequest { + // Required. The name of the OS policy assignment to list revisions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; + + // The maximum number of revisions to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListOSPolicyAssignmentRevisions` that indicates where this listing should + // continue from. + string page_token = 3; +} + +// A response message for listing all revisions for a OS policy assignment. +message ListOSPolicyAssignmentRevisionsResponse { + // The OS policy assignment revisions + repeated OSPolicyAssignment os_policy_assignments = 1; + + // The pagination token to retrieve the next page of OS policy assignment + // revisions. + string next_page_token = 2; +} + +// A request message for deleting a OS policy assignment. +message DeleteOSPolicyAssignmentRequest { + // Required. The name of the OS policy assignment to be deleted + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/osconfig_common.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/osconfig_common.proto new file mode 100644 index 00000000000..2b72d6ae945 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/osconfig_common.proto @@ -0,0 +1,38 @@ +// 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.osconfig.v1; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_outer_classname = "Common"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Message encapsulating a value that can be either absolute ("fixed") or +// relative ("percent") to a value. +message FixedOrPercent { + // Type of the value. + oneof mode { + // Specifies a fixed value. + int32 fixed = 1; + + // Specifies the relative value defined as a percentage, which will be + // multiplied by a reference value. + int32 percent = 2; + } +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/osconfig_service.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/osconfig_service.proto new file mode 100644 index 00000000000..515905c87d5 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/osconfig_service.proto @@ -0,0 +1,158 @@ +// 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.osconfig.v1; + +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/patch_deployments.proto"; +import "google/cloud/osconfig/v1/patch_jobs.proto"; +import "google/protobuf/empty.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_outer_classname = "OsConfigProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Instance" + pattern: "projects/{project}/zones/{zone}/instances/{instance}" + pattern: "projects/{project}/locations/{location}/instances/{instance}" +}; + +// OS Config API +// +// The OS Config service is a server-side component that you can use to +// manage package installations and patch jobs for virtual machine instances. +service OsConfigService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Patch VM instances by creating and running a patch job. + rpc ExecutePatchJob(ExecutePatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/patchJobs:execute" + body: "*" + }; + } + + // Get the patch job. This can be used to track the progress of an + // ongoing patch job or review the details of completed jobs. + rpc GetPatchJob(GetPatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/patchJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Cancel a patch job. The patch job must be active. Canceled patch jobs + // cannot be restarted. + rpc CancelPatchJob(CancelPatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchJobs/*}:cancel" + body: "*" + }; + } + + // Get a list of patch jobs. + rpc ListPatchJobs(ListPatchJobsRequest) returns (ListPatchJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/patchJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Get a list of instance details for a given patch job. + rpc ListPatchJobInstanceDetails(ListPatchJobInstanceDetailsRequest) + returns (ListPatchJobInstanceDetailsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/patchJobs/*}/instanceDetails" + }; + option (google.api.method_signature) = "parent"; + } + + // Create an OS Config patch deployment. + rpc CreatePatchDeployment(CreatePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/patchDeployments" + body: "patch_deployment" + }; + option (google.api.method_signature) = + "parent,patch_deployment,patch_deployment_id"; + } + + // Get an OS Config patch deployment. + rpc GetPatchDeployment(GetPatchDeploymentRequest) returns (PatchDeployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/patchDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get a page of OS Config patch deployments. + rpc ListPatchDeployments(ListPatchDeploymentsRequest) + returns (ListPatchDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/patchDeployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete an OS Config patch deployment. + rpc DeletePatchDeployment(DeletePatchDeploymentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/patchDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update an OS Config patch deployment. + rpc UpdatePatchDeployment(UpdatePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + patch: "/v1/{patch_deployment.name=projects/*/patchDeployments/*}" + body: "patch_deployment" + }; + option (google.api.method_signature) = "patch_deployment,update_mask"; + } + + // Change state of patch deployment to "PAUSED". + // Patch deployment in paused state doesn't generate patch jobs. + rpc PausePatchDeployment(PausePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchDeployments/*}:pause" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Change state of patch deployment back to "ACTIVE". + // Patch deployment in active state continues to generate patch jobs. + rpc ResumePatchDeployment(ResumePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchDeployments/*}:resume" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto new file mode 100644 index 00000000000..196737c1941 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto @@ -0,0 +1,202 @@ +// 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.osconfig.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/osconfig/v1/inventory.proto"; +import "google/cloud/osconfig/v1/os_policy_assignment_reports.proto"; +import "google/cloud/osconfig/v1/os_policy_assignments.proto"; +import "google/cloud/osconfig/v1/vulnerability.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OsConfigZonalServiceProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Zonal OS Config API +// +// The OS Config service is the server-side component that allows users to +// manage package installations and patch jobs for Compute Engine VM instances. +service OsConfigZonalService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create an OS policy assignment. + // + // This method also creates the first revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc CreateOSPolicyAssignment(CreateOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/osPolicyAssignments" + body: "os_policy_assignment" + }; + option (google.api.method_signature) = + "parent,os_policy_assignment,os_policy_assignment_id"; + option (google.longrunning.operation_info) = { + response_type: "OSPolicyAssignment" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Update an existing OS policy assignment. + // + // This method creates a new revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc UpdateOSPolicyAssignment(UpdateOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{os_policy_assignment.name=projects/*/locations/*/osPolicyAssignments/*}" + body: "os_policy_assignment" + }; + option (google.api.method_signature) = "os_policy_assignment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "OSPolicyAssignment" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Retrieve an existing OS policy assignment. + // + // This method always returns the latest revision. In order to retrieve a + // previous revision of the assignment, also provide the revision ID in the + // `name` parameter. + rpc GetOSPolicyAssignment(GetOSPolicyAssignmentRequest) + returns (OSPolicyAssignment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List the OS policy assignments under the parent resource. + // + // For each OS policy assignment, the latest revision is returned. + rpc ListOSPolicyAssignments(ListOSPolicyAssignmentsRequest) + returns (ListOSPolicyAssignmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/osPolicyAssignments" + }; + option (google.api.method_signature) = "parent"; + } + + // List the OS policy assignment revisions for a given OS policy assignment. + rpc ListOSPolicyAssignmentRevisions(ListOSPolicyAssignmentRevisionsRequest) + returns (ListOSPolicyAssignmentRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}:listRevisions" + }; + option (google.api.method_signature) = "name"; + } + + // Delete the OS policy assignment. + // + // This method creates a new revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // If the LRO completes and is not cancelled, all revisions associated with + // the OS policy assignment are deleted. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc DeleteOSPolicyAssignment(DeleteOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Get the OS policy asssignment report for the specified Compute Engine VM + // instance. + rpc GetOSPolicyAssignmentReport(GetOSPolicyAssignmentReportRequest) + returns (OSPolicyAssignmentReport) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/osPolicyAssignments/*/report}" + }; + option (google.api.method_signature) = "name"; + } + + // List OS policy asssignment reports for all Compute Engine VM instances in + // the specified zone. + rpc ListOSPolicyAssignmentReports(ListOSPolicyAssignmentReportsRequest) + returns (ListOSPolicyAssignmentReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*/osPolicyAssignments/*}/reports" + }; + option (google.api.method_signature) = "parent"; + } + + // Get inventory data for the specified VM instance. If the VM has no + // associated inventory, the message `NOT_FOUND` is returned. + rpc GetInventory(GetInventoryRequest) returns (Inventory) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/inventory}" + }; + option (google.api.method_signature) = "name"; + } + + // List inventory data for all VM instances in the specified zone. + rpc ListInventories(ListInventoriesRequest) + returns (ListInventoriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/inventories" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the vulnerability report for the specified VM instance. Only VMs with + // inventory data have vulnerability reports associated with them. + rpc GetVulnerabilityReport(GetVulnerabilityReportRequest) + returns (VulnerabilityReport) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/vulnerabilityReport}" + }; + option (google.api.method_signature) = "name"; + } + + // List vulnerability reports for all VM instances in the specified zone. + rpc ListVulnerabilityReports(ListVulnerabilityReportsRequest) + returns (ListVulnerabilityReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports" + }; + option (google.api.method_signature) = "parent"; + } +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/patch_deployments.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/patch_deployments.proto new file mode 100644 index 00000000000..d5708544f8b --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/patch_deployments.proto @@ -0,0 +1,339 @@ +// 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/patch_jobs.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/datetime.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_outer_classname = "PatchDeployments"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Patch deployments are configurations that individual patch jobs use to +// complete a patch. These configurations include instance filter, package +// repository settings, and a schedule. For more information about creating and +// managing patch deployments, see [Scheduling patch +// jobs](https://cloud.google.com/compute/docs/os-patch-management/schedule-patch-jobs). +message PatchDeployment { + option (google.api.resource) = { + type: "osconfig.googleapis.com/PatchDeployment" + pattern: "projects/{project}/patchDeployments/{patch_deployment}" + }; + + // Represents state of patch peployment. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // Active value means that patch deployment generates Patch Jobs. + ACTIVE = 1; + + // Paused value means that patch deployment does not generate + // Patch jobs. Requires user action to move in and out from this state. + PAUSED = 2; + } + + // Unique name for the patch deployment resource in a project. The patch + // deployment name is in the form: + // `projects/{project_id}/patchDeployments/{patch_deployment_id}`. + // This field is ignored when you create a new patch deployment. + string name = 1; + + // Optional. Description of the patch deployment. Length of the description is + // limited to 1024 characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. VM instances to patch. + PatchInstanceFilter instance_filter = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Patch configuration that is applied. + PatchConfig patch_config = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Duration of the patch. After the duration ends, the patch times + // out. + google.protobuf.Duration duration = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Schedule for the patch. + oneof schedule { + // Required. Schedule a one-time execution. + OneTimeSchedule one_time_schedule = 6 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule recurring executions. + RecurringSchedule recurring_schedule = 7 + [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. Time the patch deployment was created. Timestamp is in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time the patch deployment was last updated. Timestamp is in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time a patch job was started by this deployment. + // Timestamp is in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text + // format. + google.protobuf.Timestamp last_execute_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Rollout strategy of the patch job. + PatchRollout rollout = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the patch deployment. + State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Sets the time for a one time patch deployment. Timestamp is in +// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. +message OneTimeSchedule { + // Required. The desired patch job execution time. + google.protobuf.Timestamp execute_time = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Sets the time for recurring patch deployments. +message RecurringSchedule { + // Specifies the frequency of the recurring patch deployments. + enum Frequency { + // Invalid. A frequency must be specified. + FREQUENCY_UNSPECIFIED = 0; + + // Indicates that the frequency of recurrence should be expressed in terms + // of weeks. + WEEKLY = 1; + + // Indicates that the frequency of recurrence should be expressed in terms + // of months. + MONTHLY = 2; + + // Indicates that the frequency of recurrence should be expressed in terms + // of days. + DAILY = 3; + } + + // Required. Defines the time zone that `time_of_day` is relative to. + // The rules for daylight saving time are determined by the chosen time zone. + google.type.TimeZone time_zone = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The time that the recurring schedule becomes effective. + // Defaults to `create_time` of the patch deployment. + google.protobuf.Timestamp start_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end time at which a recurring patch deployment schedule is no + // longer active. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Time of the day to run a recurring deployment. + google.type.TimeOfDay time_of_day = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The frequency unit of this recurring schedule. + Frequency frequency = 5 [(google.api.field_behavior) = REQUIRED]; + + // Configurations for this recurring schedule. + // Configurations must match frequency. + oneof schedule_config { + // Required. Schedule with weekly executions. + WeeklySchedule weekly = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule with monthly executions. + MonthlySchedule monthly = 7 [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. The time the last patch job ran successfully. + google.protobuf.Timestamp last_execute_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the next patch job is scheduled to run. + google.protobuf.Timestamp next_execute_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a weekly schedule. +message WeeklySchedule { + // Required. Day of the week. + google.type.DayOfWeek day_of_week = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Represents a monthly schedule. An example of a valid monthly schedule is +// "on the third Tuesday of the month" or "on the 15th of the month". +message MonthlySchedule { + // One day in a month. + oneof day_of_month { + // Required. Week day in a month. + WeekDayOfMonth week_day_of_month = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. One day of the month. 1-31 indicates the 1st to the 31st day. + // -1 indicates the last day of the month. Months without the target day + // will be skipped. For example, a schedule to run "every month on the 31st" + // will not run in February, April, June, etc. + int32 month_day = 2 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Represents one week day in a month. An example is "the 4th Sunday". +message WeekDayOfMonth { + // Required. Week number in a month. 1-4 indicates the 1st to 4th week of the + // month. -1 indicates the last week of the month. + int32 week_ordinal = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A day of the week. + google.type.DayOfWeek day_of_week = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Represents the number of days before or after the given week day + // of month that the patch deployment is scheduled for. For example if + // `week_ordinal` and `day_of_week` values point to the second day of the + // month and this `day_offset` value is set to `3`, the patch deployment takes + // place three days after the second Tuesday of the month. If this value is + // negative, for example -5, the patches are deployed five days before before + // the second Tuesday of the month. Allowed values are in range [-30, 30]. + int32 day_offset = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for creating a patch deployment. +message CreatePatchDeploymentRequest { + // Required. The project to apply this patch deployment to in the form + // `projects/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. A name for the patch deployment in the project. When creating a + // name the following rules apply: + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the project. + string patch_deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The patch deployment to create. + PatchDeployment patch_deployment = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A request message for retrieving a patch deployment. +message GetPatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for listing patch deployments. +message ListPatchDeploymentsRequest { + // Required. The resource name of the parent in the form `projects/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. The maximum number of patch deployments to return. Default is + // 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to + // ListPatchDeployments that indicates where this listing should continue + // from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A response message for listing patch deployments. +message ListPatchDeploymentsResponse { + // The list of patch deployments. + repeated PatchDeployment patch_deployments = 1; + + // A pagination token that can be used to get the next page of patch + // deployments. + string next_page_token = 2; +} + +// A request message for deleting a patch deployment. +message DeletePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for updating a patch deployment. +message UpdatePatchDeploymentRequest { + // Required. The patch deployment to Update. + PatchDeployment patch_deployment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask that controls which fields of the patch deployment + // should be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for pausing a patch deployment. +message PausePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for resuming a patch deployment. +message ResumePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/patch_jobs.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/patch_jobs.proto new file mode 100644 index 00000000000..4edfc8df555 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/patch_jobs.proto @@ -0,0 +1,742 @@ +// 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/osconfig_common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_outer_classname = "PatchJobs"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// A request message to initiate patching across Compute Engine +// instances. +message ExecutePatchJobRequest { + // Required. The project in which to run this patch in the form `projects/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Description of the patch job. Length of the description is limited + // to 1024 characters. + string description = 2; + + // Required. Instances to patch, either explicitly or filtered by some + // criteria such as zone or labels. + PatchInstanceFilter instance_filter = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Patch configuration being applied. If omitted, instances are + // patched using the default configurations. + PatchConfig patch_config = 4; + + // Duration of the patch job. After the duration ends, the patch job + // times out. + google.protobuf.Duration duration = 5; + + // If this patch is a dry-run only, instances are contacted but + // will do nothing. + bool dry_run = 6; + + // Display name for this patch job. This does not have to be unique. + string display_name = 8; + + // Rollout strategy of the patch job. + PatchRollout rollout = 9; +} + +// Request to get an active or completed patch job. +message GetPatchJobRequest { + // Required. Name of the patch in the form `projects/*/patchJobs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; +} + +// Request to list details for all instances that are part of a patch job. +message ListPatchJobInstanceDetailsRequest { + // Required. The parent for the instances are in the form of + // `projects/*/patchJobs/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; + + // The maximum number of instance details records to return. Default is 100. + int32 page_size = 2; + + // A pagination token returned from a previous call + // that indicates where this listing should continue from. + string page_token = 3; + + // A filter expression that filters results listed in the response. This + // field supports filtering results by instance zone, name, state, or + // `failure_reason`. + string filter = 4; +} + +// A response message for listing the instances details for a patch job. +message ListPatchJobInstanceDetailsResponse { + // A list of instance status. + repeated PatchJobInstanceDetails patch_job_instance_details = 1; + + // A pagination token that can be used to get the next page of results. + string next_page_token = 2; +} + +// Patch details for a VM instance. For more information about reviewing VM +// instance details, see +// [Listing all VM instance details for a specific patch +// job](https://cloud.google.com/compute/docs/os-patch-management/manage-patch-jobs#list-instance-details). +message PatchJobInstanceDetails { + // The instance name in the form `projects/*/zones/*/instances/*` + string name = 1 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + }]; + + // The unique identifier for the instance. This identifier is + // defined by the server. + string instance_system_id = 2; + + // Current state of instance patch. + Instance.PatchState state = 3; + + // If the patch fails, this field provides the reason. + string failure_reason = 4; + + // The number of times the agent that the agent attempts to apply the patch. + int64 attempt_count = 5; +} + +// A request message for listing patch jobs. +message ListPatchJobsRequest { + // Required. In the form of `projects/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // The maximum number of instance status to return. + int32 page_size = 2; + + // A pagination token returned from a previous call + // that indicates where this listing should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by patch + // jobs to be included in the response. + // Currently, filtering is only available on the patch_deployment field. + string filter = 4; +} + +// A response message for listing patch jobs. +message ListPatchJobsResponse { + // The list of patch jobs. + repeated PatchJob patch_jobs = 1; + + // A pagination token that can be used to get the next page of results. + string next_page_token = 2; +} + +// A high level representation of a patch job that is either in progress +// or has completed. +// +// Instance details are not included in the job. To paginate through instance +// details, use ListPatchJobInstanceDetails. +// +// For more information about patch jobs, see +// [Creating patch +// jobs](https://cloud.google.com/compute/docs/os-patch-management/create-patch-job). +message PatchJob { + option (google.api.resource) = { + type: "osconfig.googleapis.com/PatchJob" + pattern: "projects/{project}/patchJobs/{patch_job}" + }; + + // Enumeration of the various states a patch job passes through as it + // executes. + enum State { + // State must be specified. + STATE_UNSPECIFIED = 0; + + // The patch job was successfully initiated. + STARTED = 1; + + // The patch job is looking up instances to run the patch on. + INSTANCE_LOOKUP = 2; + + // Instances are being patched. + PATCHING = 3; + + // Patch job completed successfully. + SUCCEEDED = 4; + + // Patch job completed but there were errors. + COMPLETED_WITH_ERRORS = 5; + + // The patch job was canceled. + CANCELED = 6; + + // The patch job timed out. + TIMED_OUT = 7; + } + + // A summary of the current patch state across all instances that this patch + // job affects. Contains counts of instances in different states. These states + // map to `InstancePatchState`. List patch job instance details to see the + // specific states of each instance. + message InstanceDetailsSummary { + // Number of instances pending patch job. + int64 pending_instance_count = 1; + + // Number of instances that are inactive. + int64 inactive_instance_count = 2; + + // Number of instances notified about patch job. + int64 notified_instance_count = 3; + + // Number of instances that have started. + int64 started_instance_count = 4; + + // Number of instances that are downloading patches. + int64 downloading_patches_instance_count = 5; + + // Number of instances that are applying patches. + int64 applying_patches_instance_count = 6; + + // Number of instances rebooting. + int64 rebooting_instance_count = 7; + + // Number of instances that have completed successfully. + int64 succeeded_instance_count = 8; + + // Number of instances that require reboot. + int64 succeeded_reboot_required_instance_count = 9; + + // Number of instances that failed. + int64 failed_instance_count = 10; + + // Number of instances that have acked and will start shortly. + int64 acked_instance_count = 11; + + // Number of instances that exceeded the time out while applying the patch. + int64 timed_out_instance_count = 12; + + // Number of instances that are running the pre-patch step. + int64 pre_patch_step_instance_count = 13; + + // Number of instances that are running the post-patch step. + int64 post_patch_step_instance_count = 14; + + // Number of instances that do not appear to be running the agent. Check to + // ensure that the agent is installed, running, and able to communicate with + // the service. + int64 no_agent_detected_instance_count = 15; + } + + // Unique identifier for this patch job in the form + // `projects/*/patchJobs/*` + string name = 1; + + // Display name for this patch job. This is not a unique identifier. + string display_name = 14; + + // Description of the patch job. Length of the description is limited + // to 1024 characters. + string description = 2; + + // Time this patch job was created. + google.protobuf.Timestamp create_time = 3; + + // Last time this patch job was updated. + google.protobuf.Timestamp update_time = 4; + + // The current state of the PatchJob. + State state = 5; + + // Instances to patch. + PatchInstanceFilter instance_filter = 13; + + // Patch configuration being applied. + PatchConfig patch_config = 7; + + // Duration of the patch job. After the duration ends, the + // patch job times out. + google.protobuf.Duration duration = 8; + + // Summary of instance details. + InstanceDetailsSummary instance_details_summary = 9; + + // If this patch job is a dry run, the agent reports that it has + // finished without running any updates on the VM instance. + bool dry_run = 10; + + // If this patch job failed, this message provides information about the + // failure. + string error_message = 11; + + // Reflects the overall progress of the patch job in the range of + // 0.0 being no progress to 100.0 being complete. + double percent_complete = 12; + + // Output only. Name of the patch deployment that created this patch job. + string patch_deployment = 15 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; + + // Rollout strategy being applied. + PatchRollout rollout = 16; +} + +// Patch configuration specifications. Contains details on how to apply the +// patch(es) to a VM instance. +message PatchConfig { + // Post-patch reboot settings. + enum RebootConfig { + // The default behavior is DEFAULT. + REBOOT_CONFIG_UNSPECIFIED = 0; + + // The agent decides if a reboot is necessary by checking signals such as + // registry keys on Windows or `/var/run/reboot-required` on APT based + // systems. On RPM based systems, a set of core system package install times + // are compared with system boot time. + DEFAULT = 1; + + // Always reboot the machine after the update completes. + ALWAYS = 2; + + // Never reboot the machine after the update completes. + NEVER = 3; + } + + // Post-patch reboot settings. + RebootConfig reboot_config = 1; + + // Apt update settings. Use this setting to override the default `apt` patch + // rules. + AptSettings apt = 3; + + // Yum update settings. Use this setting to override the default `yum` patch + // rules. + YumSettings yum = 4; + + // Goo update settings. Use this setting to override the default `goo` patch + // rules. + GooSettings goo = 5; + + // Zypper update settings. Use this setting to override the default `zypper` + // patch rules. + ZypperSettings zypper = 6; + + // Windows update settings. Use this override the default windows patch rules. + WindowsUpdateSettings windows_update = 7; + + // The `ExecStep` to run before the patch update. + ExecStep pre_step = 8; + + // The `ExecStep` to run after the patch update. + ExecStep post_step = 9; + + // Allows the patch job to run on Managed instance groups (MIGs). + bool mig_instances_allowed = 10; +} + +// Namespace for instance state enums. +message Instance { + // Patch state of an instance. + enum PatchState { + // Unspecified. + PATCH_STATE_UNSPECIFIED = 0; + + // The instance is not yet notified. + PENDING = 1; + + // Instance is inactive and cannot be patched. + INACTIVE = 2; + + // The instance is notified that it should be patched. + NOTIFIED = 3; + + // The instance has started the patching process. + STARTED = 4; + + // The instance is downloading patches. + DOWNLOADING_PATCHES = 5; + + // The instance is applying patches. + APPLYING_PATCHES = 6; + + // The instance is rebooting. + REBOOTING = 7; + + // The instance has completed applying patches. + SUCCEEDED = 8; + + // The instance has completed applying patches but a reboot is required. + SUCCEEDED_REBOOT_REQUIRED = 9; + + // The instance has failed to apply the patch. + FAILED = 10; + + // The instance acked the notification and will start shortly. + ACKED = 11; + + // The instance exceeded the time out while applying the patch. + TIMED_OUT = 12; + + // The instance is running the pre-patch step. + RUNNING_PRE_PATCH_STEP = 13; + + // The instance is running the post-patch step. + RUNNING_POST_PATCH_STEP = 14; + + // The service could not detect the presence of the agent. Check to ensure + // that the agent is installed, running, and able to communicate with the + // service. + NO_AGENT_DETECTED = 15; + } +} + +// Message for canceling a patch job. +message CancelPatchJobRequest { + // Required. Name of the patch in the form `projects/*/patchJobs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; +} + +// Apt patching is completed by executing `apt-get update && apt-get +// upgrade`. Additional options can be set to control how this is executed. +message AptSettings { + // Apt patch type. + enum Type { + // By default, upgrade will be performed. + TYPE_UNSPECIFIED = 0; + + // Runs `apt-get dist-upgrade`. + DIST = 1; + + // Runs `apt-get upgrade`. + UPGRADE = 2; + } + + // By changing the type to DIST, the patching is performed + // using `apt-get dist-upgrade` instead. + Type type = 1; + + // List of packages to exclude from update. These packages will be excluded + repeated string excludes = 2; + + // An exclusive list of packages to be updated. These are the only packages + // that will be updated. If these packages are not installed, they will be + // ignored. This field cannot be specified with any other patch configuration + // fields. + repeated string exclusive_packages = 3; +} + +// Yum patching is performed by executing `yum update`. Additional options +// can be set to control how this is executed. +// +// Note that not all settings are supported on all platforms. +message YumSettings { + // Adds the `--security` flag to `yum update`. Not supported on + // all platforms. + bool security = 1; + + // Will cause patch to run `yum update-minimal` instead. + bool minimal = 2; + + // List of packages to exclude from update. These packages are excluded by + // using the yum `--exclude` flag. + repeated string excludes = 3; + + // An exclusive list of packages to be updated. These are the only packages + // that will be updated. If these packages are not installed, they will be + // ignored. This field must not be specified with any other patch + // configuration fields. + repeated string exclusive_packages = 4; +} + +// Googet patching is performed by running `googet update`. +message GooSettings {} + +// Zypper patching is performed by running `zypper patch`. +// See also https://en.opensuse.org/SDB:Zypper_manual. +message ZypperSettings { + // Adds the `--with-optional` flag to `zypper patch`. + bool with_optional = 1; + + // Adds the `--with-update` flag, to `zypper patch`. + bool with_update = 2; + + // Install only patches with these categories. + // Common categories include security, recommended, and feature. + repeated string categories = 3; + + // Install only patches with these severities. + // Common severities include critical, important, moderate, and low. + repeated string severities = 4; + + // List of patches to exclude from update. + repeated string excludes = 5; + + // An exclusive list of patches to be updated. These are the only patches + // that will be installed using 'zypper patch patch:' command. + // This field must not be used with any other patch configuration fields. + repeated string exclusive_patches = 6; +} + +// Windows patching is performed using the Windows Update Agent. +message WindowsUpdateSettings { + // Microsoft Windows update classifications as defined in + // [1] + // https://support.microsoft.com/en-us/help/824684/description-of-the-standard-terminology-that-is-used-to-describe-micro + enum Classification { + // Invalid. If classifications are included, they must be specified. + CLASSIFICATION_UNSPECIFIED = 0; + + // "A widely released fix for a specific problem that addresses a critical, + // non-security-related bug." [1] + CRITICAL = 1; + + // "A widely released fix for a product-specific, security-related + // vulnerability. Security vulnerabilities are rated by their severity. The + // severity rating is indicated in the Microsoft security bulletin as + // critical, important, moderate, or low." [1] + SECURITY = 2; + + // "A widely released and frequent software update that contains additions + // to a product's definition database. Definition databases are often used + // to detect objects that have specific attributes, such as malicious code, + // phishing websites, or junk mail." [1] + DEFINITION = 3; + + // "Software that controls the input and output of a device." [1] + DRIVER = 4; + + // "New product functionality that is first distributed outside the context + // of a product release and that is typically included in the next full + // product release." [1] + FEATURE_PACK = 5; + + // "A tested, cumulative set of all hotfixes, security updates, critical + // updates, and updates. Additionally, service packs may contain additional + // fixes for problems that are found internally since the release of the + // product. Service packs my also contain a limited number of + // customer-requested design changes or features." [1] + SERVICE_PACK = 6; + + // "A utility or feature that helps complete a task or set of tasks." [1] + TOOL = 7; + + // "A tested, cumulative set of hotfixes, security updates, critical + // updates, and updates that are packaged together for easy deployment. A + // rollup generally targets a specific area, such as security, or a + // component of a product, such as Internet Information Services (IIS)." [1] + UPDATE_ROLLUP = 8; + + // "A widely released fix for a specific problem. An update addresses a + // noncritical, non-security-related bug." [1] + UPDATE = 9; + } + + // Only apply updates of these windows update classifications. If empty, all + // updates are applied. + repeated Classification classifications = 1; + + // List of KBs to exclude from update. + repeated string excludes = 2; + + // An exclusive list of kbs to be updated. These are the only patches + // that will be updated. This field must not be used with other + // patch configurations. + repeated string exclusive_patches = 3; +} + +// A step that runs an executable for a PatchJob. +message ExecStep { + // The ExecStepConfig for all Linux VMs targeted by the PatchJob. + ExecStepConfig linux_exec_step_config = 1; + + // The ExecStepConfig for all Windows VMs targeted by the PatchJob. + ExecStepConfig windows_exec_step_config = 2; +} + +// Common configurations for an ExecStep. +message ExecStepConfig { + // The interpreter used to execute the a file. + enum Interpreter { + // Invalid for a Windows ExecStepConfig. For a Linux ExecStepConfig, the + // interpreter will be parsed from the shebang line of the script if + // unspecified. + INTERPRETER_UNSPECIFIED = 0; + + // Indicates that the script is run with `/bin/sh` on Linux and `cmd` + // on Windows. + SHELL = 1; + + // Indicates that the file is run with PowerShell flags + // `-NonInteractive`, `-NoProfile`, and `-ExecutionPolicy Bypass`. + POWERSHELL = 2; + } + + // Location of the executable. + oneof executable { + // An absolute path to the executable on the VM. + string local_path = 1; + + // A Cloud Storage object containing the executable. + GcsObject gcs_object = 2; + } + + // Defaults to [0]. A list of possible return values that the + // execution can return to indicate a success. + repeated int32 allowed_success_codes = 3; + + // The script interpreter to use to run the script. If no interpreter is + // specified the script will be executed directly, which will likely + // only succeed for scripts with [shebang lines] + // (https://en.wikipedia.org/wiki/Shebang_\(Unix\)). + Interpreter interpreter = 4; +} + +// Cloud Storage object representation. +message GcsObject { + // Required. Bucket of the Cloud Storage object. + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the Cloud Storage object. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Generation number of the Cloud Storage object. This is used to + // ensure that the ExecStep specified by this PatchJob does not change. + int64 generation_number = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A filter to target VM instances for patching. The targeted +// VMs must meet all criteria specified. So if both labels and zones are +// specified, the patch job targets only VMs with those labels and in those +// zones. +message PatchInstanceFilter { + // Targets a group of VM instances by using their [assigned + // labels](https://cloud.google.com/compute/docs/labeling-resources). Labels + // are key-value pairs. A `GroupLabel` is a combination of labels + // that is used to target VMs for a patch job. + // + // For example, a patch job can target VMs that have the following + // `GroupLabel`: `{"env":"test", "app":"web"}`. This means that the patch job + // is applied to VMs that have both the labels `env=test` and `app=web`. + message GroupLabel { + // Compute Engine instance labels that must be present for a VM + // instance to be targeted by this filter. + map labels = 1; + } + + // Target all VM instances in the project. If true, no other criteria is + // permitted. + bool all = 1; + + // Targets VM instances matching ANY of these GroupLabels. This allows + // targeting of disparate groups of VM instances. + repeated GroupLabel group_labels = 2; + + // Targets VM instances in ANY of these zones. Leave empty to target VM + // instances in any zone. + repeated string zones = 3; + + // Targets any of the VM instances specified. Instances are specified by their + // URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`, + // `projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]`, or + // `https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]` + repeated string instances = 4; + + // Targets VMs whose name starts with one of these prefixes. Similar to + // labels, this is another way to group VMs when targeting configs, for + // example prefix="prod-". + repeated string instance_name_prefixes = 5; +} + +// Patch rollout configuration specifications. Contains details on the +// concurrency control when applying patch(es) to all targeted VMs. +message PatchRollout { + // Type of the rollout. + enum Mode { + // Mode must be specified. + MODE_UNSPECIFIED = 0; + + // Patches are applied one zone at a time. The patch job begins in the + // region with the lowest number of targeted VMs. Within the region, + // patching begins in the zone with the lowest number of targeted VMs. If + // multiple regions (or zones within a region) have the same number of + // targeted VMs, a tie-breaker is achieved by sorting the regions or zones + // in alphabetical order. + ZONE_BY_ZONE = 1; + + // Patches are applied to VMs in all zones at the same time. + CONCURRENT_ZONES = 2; + } + + // Mode of the patch rollout. + Mode mode = 1; + + // The maximum number (or percentage) of VMs per zone to disrupt at any given + // moment. The number of VMs calculated from multiplying the percentage by the + // total number of VMs in a zone is rounded up. + // + // During patching, a VM is considered disrupted from the time the agent is + // notified to begin until patching has completed. This disruption time + // includes the time to complete reboot and any post-patch steps. + // + // A VM contributes to the disruption budget if its patching operation fails + // either when applying the patches, running pre or post patch steps, or if it + // fails to respond with a success notification before timing out. VMs that + // are not running or do not have an active agent do not count toward this + // disruption budget. + // + // For zone-by-zone rollouts, if the disruption budget in a zone is exceeded, + // the patch job stops, because continuing to the next zone requires + // completion of the patch process in the previous zone. + // + // For example, if the disruption budget has a fixed value of `10`, and 8 VMs + // fail to patch in the current zone, the patch job continues to patch 2 VMs + // at a time until the zone is completed. When that zone is completed + // successfully, patching begins with 10 VMs at a time in the next zone. If 10 + // VMs in the next zone fail to patch, the patch job stops. + FixedOrPercent disruption_budget = 2; +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/vulnerability.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/vulnerability.proto new file mode 100644 index 00000000000..b8ca5175ce0 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1/vulnerability.proto @@ -0,0 +1,365 @@ +// 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "VulnerabilityProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// This API resource represents the vulnerability report for a specified +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// For more information, see [Vulnerability +// reports](https://cloud.google.com/compute/docs/instances/os-inventory-management#vulnerability-reports). +message VulnerabilityReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport" + }; + + // A vulnerability affecting the VM instance. + message Vulnerability { + // Contains metadata information for the vulnerability. This information is + // collected from the upstream feed of the operating system. + message Details { + // A reference for this vulnerability. + message Reference { + // The url of the reference. + string url = 1; + + // The source of the reference e.g. NVD. + string source = 2; + } + + // The CVE of the vulnerability. CVE cannot be + // empty and the combination of should be unique + // across vulnerabilities for a VM. + string cve = 1; + + // The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of + // 0 - 10 where 0 indicates low severity and 10 indicates high severity. + float cvss_v2_score = 2; + + // The full description of the CVSSv3 for this vulnerability from NVD. + CVSSv3 cvss_v3 = 3; + + // Assigned severity/impact ranking from the distro. + string severity = 4; + + // The note or description describing the vulnerability from the distro. + string description = 5; + + // Corresponds to the references attached to the `VulnerabilityDetails`. + repeated Reference references = 6; + } + + // OS inventory item that is affected by a vulnerability or fixed as a + // result of a vulnerability. + message Item { + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some + // operating systems, this field might be empty. + string installed_inventory_item_id = 1; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + string available_inventory_item_id = 2; + + // The recommended [CPE URI](https://cpe.mitre.org/specification/) update + // that contains a fix for this vulnerability. + string fixed_cpe_uri = 3; + + // The upstream OS patch, packages or KB that fixes the vulnerability. + string upstream_fix = 4; + } + + // Contains metadata as per the upstream feed of the operating system and + // NVD. + Details details = 1; + + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some distros, + // this field may be empty. + repeated string installed_inventory_item_ids = 2 [deprecated = true]; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + repeated string available_inventory_item_ids = 3 [deprecated = true]; + + // The timestamp for when the vulnerability was first detected. + google.protobuf.Timestamp create_time = 4; + + // The timestamp for when the vulnerability was last modified. + google.protobuf.Timestamp update_time = 5; + + // List of items affected by the vulnerability. + repeated Item items = 6; + } + + // Output only. The `vulnerabilityReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of vulnerabilities affecting the VM. + repeated Vulnerability vulnerabilities = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp for when the last vulnerability report was generated for the + // VM. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting the vulnerability report for the specified VM. +message GetVulnerabilityReportRequest { + // Required. API resource name for vulnerability resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + } + ]; +} + +// A request message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListVulnerabilityReports` that indicates where this listing + // should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by a + // `vulnerabilityReport` API resource to be included in the response. + string filter = 4; +} + +// A response message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsResponse { + // List of vulnerabilityReport objects. + repeated VulnerabilityReport vulnerability_reports = 1; + + // The pagination token to retrieve the next page of vulnerabilityReports + // object. + string next_page_token = 2; +} + +// Common Vulnerability Scoring System version 3. +// For details, see https://www.first.org/cvss/specification-document +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. + // https://www.first.org/cvss/specification-document#Base-Metrics + float base_score = 1; + + // The Exploitability sub-score equation is derived from the Base + // Exploitability metrics. + // https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics + float exploitability_score = 2; + + // The Impact sub-score equation is derived from the Base Impact metrics. + float impact_score = 3; + + // 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-osconfig/protos/google/cloud/osconfig/v1alpha/config_common.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/config_common.proto new file mode 100644 index 00000000000..a7a50c716bf --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/config_common.proto @@ -0,0 +1,133 @@ +// 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.osconfig.v1alpha; + + +option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "ConfigCommonProto"; +option java_package = "com.google.cloud.osconfig.v1alpha"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha"; +option ruby_package = "Google::Cloud::OsConfig::V1alpha"; + +// Step performed by the OS Config agent for configuring an `OSPolicyResource` +// to its desired state. +message OSPolicyResourceConfigStep { + option deprecated = true; + + // Supported configuration step types + enum Type { + option deprecated = true; + + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // Validation to detect resource conflicts, schema errors, etc. + VALIDATION = 1; + + // Check the current desired state status of the resource. + DESIRED_STATE_CHECK = 2; + + // Enforce the desired state for a resource that is not in desired state. + DESIRED_STATE_ENFORCEMENT = 3; + + // Re-check desired state status for a resource after enforcement of all + // resources in the current configuration run. + // + // This step is used to determine the final desired state status for the + // resource. It accounts for any resources that might have drifted from + // their desired state due to side effects from configuring other resources + // during the current configuration run. + DESIRED_STATE_CHECK_POST_ENFORCEMENT = 4; + } + + // Supported outcomes for a configuration step. + enum Outcome { + option deprecated = true; + + // Default value. This value is unused. + OUTCOME_UNSPECIFIED = 0; + + // The step succeeded. + SUCCEEDED = 1; + + // The step failed. + FAILED = 2; + } + + // Configuration step type. + Type type = 1; + + // Outcome of the configuration step. + Outcome outcome = 2; + + // An error message recorded during the execution of this step. + // Only populated when outcome is FAILED. + string error_message = 3; +} + +// Compliance data for an OS policy resource. +message OSPolicyResourceCompliance { + option deprecated = true; + + // ExecResource specific output. + message ExecResourceOutput { + option deprecated = true; + + // Output from Enforcement phase output file (if run). + // Output size is limited to 100K bytes. + bytes enforcement_output = 2; + } + + // The id of the OS policy resource. + string os_policy_resource_id = 1; + + // Ordered list of configuration steps taken by the agent for the OS policy + // resource. + repeated OSPolicyResourceConfigStep config_steps = 2; + + // Compliance state of the OS policy resource. + OSPolicyComplianceState state = 3; + + // Resource specific output. + oneof output { + // ExecResource specific output. + ExecResourceOutput exec_resource_output = 4; + } +} + +// Supported OSPolicy compliance states. +enum OSPolicyComplianceState { + option deprecated = true; + + // Default value. This value is unused. + OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED = 0; + + // Compliant state. + COMPLIANT = 1; + + // Non-compliant state + NON_COMPLIANT = 2; + + // Unknown compliance state. + UNKNOWN = 3; + + // No applicable OS policies were found for the instance. + // This state is only applicable to the instance. + NO_OS_POLICIES_APPLICABLE = 4; +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/instance_os_policies_compliance.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/instance_os_policies_compliance.proto new file mode 100644 index 00000000000..501ac3aef3f --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/instance_os_policies_compliance.proto @@ -0,0 +1,182 @@ +// 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.osconfig.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1alpha/config_common.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "InstanceOSPoliciesComplianceProto"; +option java_package = "com.google.cloud.osconfig.v1alpha"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha"; +option ruby_package = "Google::Cloud::OsConfig::V1alpha"; + +// This API resource represents the OS policies compliance data for a Compute +// Engine virtual machine (VM) instance at a given point in time. +// +// A Compute Engine VM can have multiple OS policy assignments, and each +// assignment can have multiple OS policies. As a result, multiple OS policies +// could be applied to a single VM. +// +// You can use this API resource to determine both the compliance state of your +// VM as well as the compliance state of an individual OS policy. +// +// For more information, see [View +// compliance](https://cloud.google.com/compute/docs/os-configuration-management/view-compliance). +message InstanceOSPoliciesCompliance { + option deprecated = true; + option (google.api.resource) = { + type: "osconfig.googleapis.com/InstanceOSPoliciesCompliance" + pattern: "projects/{project}/locations/{location}/instanceOSPoliciesCompliances/{instance}" + }; + + // Compliance data for an OS policy + message OSPolicyCompliance { + option deprecated = true; + + // The OS policy id + string os_policy_id = 1; + + // Reference to the `OSPolicyAssignment` API resource that the `OSPolicy` + // belongs to. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` + string os_policy_assignment = 2 [(google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + }]; + + // Compliance state of the OS policy. + OSPolicyComplianceState state = 4; + + // Compliance data for each `OSPolicyResource` that is applied to the + // VM. + repeated OSPolicyResourceCompliance os_policy_resource_compliances = 5; + } + + // Output only. The `InstanceOSPoliciesCompliance` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instanceOSPoliciesCompliances/{instance_id}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Compute Engine VM instance name. + string instance = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Compliance state of the VM. + OSPolicyComplianceState state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Detailed compliance state of the VM. + // This field is populated only when compliance state is `UNKNOWN`. + // + // It may contain one of the following values: + // + // * `no-compliance-data`: Compliance data is not available for this VM. + // * `no-agent-detected`: OS Config agent is not detected for this VM. + // * `config-not-supported-by-agent`: The version of the OS Config agent + // running on this VM does not support configuration management. + // * `inactive`: VM is not running. + // * `internal-service-errors`: There were internal service errors encountered + // while enforcing compliance. + // * `agent-errors`: OS config agent encountered errors while enforcing + // compliance. + string detailed_state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The reason for the `detailed_state` of the VM (if any). + string detailed_state_reason = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Compliance data for each `OSPolicy` that is applied to the VM. + repeated OSPolicyCompliance os_policy_compliances = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of the last compliance check for the VM. + google.protobuf.Timestamp last_compliance_check_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Unique identifier for the last compliance run. + // This id will be logged by the OS config agent during a compliance run and + // can be used for debugging and tracing purpose. + string last_compliance_run_id = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting OS policies compliance data for the given +// Compute Engine VM instance. +message GetInstanceOSPoliciesComplianceRequest { + option deprecated = true; + + // Required. API resource name for instance OS policies compliance resource. + // + // Format: + // `projects/{project}/locations/{location}/instanceOSPoliciesCompliances/{instance}` + // + // For `{project}`, either Compute Engine project-number or project-id can be + // provided. + // For `{instance}`, either Compute Engine VM instance-id or instance-name can + // be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/InstanceOSPoliciesCompliance" + } + ]; +} + +// A request message for listing OS policies compliance data for all Compute +// Engine VMs in the given location. +message ListInstanceOSPoliciesCompliancesRequest { + option deprecated = true; + + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}` + // + // For `{project}`, either Compute Engine project-number or project-id can be + // provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListInstanceOSPoliciesCompliances` that indicates where this listing + // should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by a + // `InstanceOSPoliciesCompliance` API resource to be included in the response. + string filter = 4; +} + +// A response message for listing OS policies compliance data for all Compute +// Engine VMs in the given location. +message ListInstanceOSPoliciesCompliancesResponse { + option deprecated = true; + + // List of instance OS policies compliance objects. + repeated InstanceOSPoliciesCompliance instance_os_policies_compliances = 1; + + // The pagination token to retrieve the next page of instance OS policies + // compliance objects. + string next_page_token = 2; +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/inventory.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/inventory.proto new file mode 100644 index 00000000000..c524ae1c93e --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/inventory.proto @@ -0,0 +1,383 @@ +// 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.osconfig.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "Inventories"; +option java_package = "com.google.cloud.osconfig.v1alpha"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha"; +option ruby_package = "Google::Cloud::OsConfig::V1alpha"; + +// OS Inventory is a service for collecting and reporting operating +// system and package information on VM instances. + +// This API resource represents the available inventory data for a +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// You can use this API resource to determine the inventory data of your VM. +// +// For more information, see [Information provided by OS inventory +// management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected). +message Inventory { + option (google.api.resource) = { + type: "osconfig.googleapis.com/Inventory" + pattern: "projects/{project}/locations/{location}/instances/{instance}/inventory" + }; + + // Operating system information for the VM. + message OsInfo { + // The VM hostname. + string hostname = 9; + + // The operating system long name. + // For example 'Debian GNU/Linux 9' or 'Microsoft Window Server 2019 + // Datacenter'. + string long_name = 2; + + // The operating system short name. + // For example, 'windows' or 'debian'. + string short_name = 3; + + // The version of the operating system. + string version = 4; + + // The system architecture of the operating system. + string architecture = 5; + + // The kernel version of the operating system. + string kernel_version = 6; + + // The kernel release of the operating system. + string kernel_release = 7; + + // The current version of the OS Config agent running on the VM. + string osconfig_agent_version = 8; + } + + // A single piece of inventory on a VM. + message Item { + // The origin of a specific inventory item. + enum OriginType { + // Invalid. An origin type must be specified. + ORIGIN_TYPE_UNSPECIFIED = 0; + + // This inventory item was discovered as the result of the agent + // reporting inventory via the reporting API. + INVENTORY_REPORT = 1; + } + + // The different types of inventory that are tracked on a VM. + enum Type { + // Invalid. An type must be specified. + TYPE_UNSPECIFIED = 0; + + // This represents a package that is installed on the VM. + INSTALLED_PACKAGE = 1; + + // This represents an update that is available for a package. + AVAILABLE_PACKAGE = 2; + } + + // Identifier for this item, unique across items for this VM. + string id = 1; + + // The origin of this inventory item. + OriginType origin_type = 2; + + // When this inventory item was first detected. + google.protobuf.Timestamp create_time = 8; + + // When this inventory item was last modified. + google.protobuf.Timestamp update_time = 9; + + // The specific type of inventory, correlating to its specific details. + Type type = 5; + + // Specific details of this inventory item based on its type. + oneof details { + // Software package present on the VM instance. + SoftwarePackage installed_package = 6; + + // Software package available to be installed on the VM instance. + SoftwarePackage available_package = 7; + } + } + + // Software package information of the operating system. + message SoftwarePackage { + // Information about the different types of software packages. + oneof details { + // Yum package info. + // For details about the yum package manager, see + // https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/ch-yum. + VersionedPackage yum_package = 1; + + // Details of an APT package. + // For details about the apt package manager, see + // https://wiki.debian.org/Apt. + VersionedPackage apt_package = 2; + + // Details of a Zypper package. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + VersionedPackage zypper_package = 3; + + // Details of a Googet package. + // For details about the googet package manager, see + // https://github.com/google/googet. + VersionedPackage googet_package = 4; + + // Details of a Zypper patch. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + ZypperPatch zypper_patch = 5; + + // Details of a Windows Update package. + // See https://docs.microsoft.com/en-us/windows/win32/api/_wua/ for + // information about Windows Update. + WindowsUpdatePackage wua_package = 6; + + // Details of a Windows Quick Fix engineering package. + // See + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + // for info in Windows Quick Fix Engineering. + WindowsQuickFixEngineeringPackage qfe_package = 7; + + // Details of a COS package. + VersionedPackage cos_package = 8; + + // Details of Windows Application. + WindowsApplication windows_application = 9; + } + } + + // Information related to the a standard versioned package. This includes + // package info for APT, Yum, Zypper, and Googet package managers. + message VersionedPackage { + // The name of the package. + string package_name = 4; + + // The system architecture this package is intended for. + string architecture = 2; + + // The version of the package. + string version = 3; + } + + // Details related to a Zypper Patch. + message ZypperPatch { + // The name of the patch. + string patch_name = 5; + + // The category of the patch. + string category = 2; + + // The severity specified for this patch + string severity = 3; + + // Any summary information provided about this patch. + string summary = 4; + } + + // Details related to a Windows Update package. + // Field data and names are taken from Windows Update API IUpdate Interface: + // https://docs.microsoft.com/en-us/windows/win32/api/_wua/ + // Descriptive fields like title, and description are localized based on + // the locale of the VM being updated. + message WindowsUpdatePackage { + // Categories specified by the Windows Update. + message WindowsUpdateCategory { + // The identifier of the windows update category. + string id = 1; + + // The name of the windows update category. + string name = 2; + } + + // The localized title of the update package. + string title = 1; + + // The localized description of the update package. + string description = 2; + + // The categories that are associated with this update package. + repeated WindowsUpdateCategory categories = 3; + + // A collection of Microsoft Knowledge Base article IDs that are associated + // with the update package. + repeated string kb_article_ids = 4; + + // A hyperlink to the language-specific support information for the update. + string support_url = 11; + + // A collection of URLs that provide more information about the update + // package. + repeated string more_info_urls = 5; + + // Gets the identifier of an update package. Stays the same across + // revisions. + string update_id = 6; + + // The revision number of this update package. + int32 revision_number = 7; + + // The last published date of the update, in (UTC) date and time. + google.protobuf.Timestamp last_deployment_change_time = 10; + } + + // Information related to a Quick Fix Engineering package. + // Fields are taken from Windows QuickFixEngineering Interface and match + // the source names: + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + message WindowsQuickFixEngineeringPackage { + // A short textual description of the QFE update. + string caption = 1; + + // A textual description of the QFE update. + string description = 2; + + // Unique identifier associated with a particular QFE update. + string hot_fix_id = 3; + + // Date that the QFE update was installed. Mapped from installed_on field. + google.protobuf.Timestamp install_time = 5; + } + + // Contains information about a Windows application that is retrieved from the + // Windows Registry. For more information about these fields, see: + // https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key + message WindowsApplication { + // The name of the application or product. + string display_name = 1; + + // The version of the product or application in string format. + string display_version = 2; + + // The name of the manufacturer for the product or application. + string publisher = 3; + + // The last time this product received service. The value of this property + // is replaced each time a patch is applied or removed from the product or + // the command-line option is used to repair the product. + google.type.Date install_date = 4; + + // The internet address for technical support. + string help_link = 5; + } + + // Output only. The `Inventory` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory` + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Base level operating system information for the VM. + OsInfo os_info = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Inventory items related to the VM keyed by an opaque unique identifier for + // each inventory item. The identifier is unique to each distinct and + // addressable inventory item and will change, when there is a new package + // version. + map items = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of the last reported inventory for the VM. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting inventory data for the specified VM. +message GetInventoryRequest { + // Required. API resource name for inventory resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/inventory` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/Inventory" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; +} + +// A request message for listing inventory data for all VMs in the specified +// location. +message ListInventoriesRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; + + // The maximum number of results to return. + int32 page_size = 3; + + // A pagination token returned from a previous call to + // `ListInventories` that indicates where this listing + // should continue from. + string page_token = 4; + + // If provided, this field specifies the criteria that must be met by a + // `Inventory` API resource to be included in the response. + string filter = 5; +} + +// A response message for listing inventory data for all VMs in a specified +// location. +message ListInventoriesResponse { + // List of inventory objects. + repeated Inventory inventories = 1; + + // The pagination token to retrieve the next page of inventory objects. + string next_page_token = 2; +} + +// The view for inventory objects. +enum InventoryView { + // The default value. + // The API defaults to the BASIC view. + INVENTORY_VIEW_UNSPECIFIED = 0; + + // Returns the basic inventory information that includes `os_info`. + BASIC = 1; + + // Returns all fields. + FULL = 2; +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/os_policy.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/os_policy.proto new file mode 100644 index 00000000000..578d82a1e69 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/os_policy.proto @@ -0,0 +1,565 @@ +// 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.osconfig.v1alpha; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OsPolicyProto"; +option java_package = "com.google.cloud.osconfig.v1alpha"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha"; +option ruby_package = "Google::Cloud::OsConfig::V1alpha"; + +// An OS policy defines the desired state configuration for a VM. +message OSPolicy { + // Policy mode + enum Mode { + // Invalid mode + MODE_UNSPECIFIED = 0; + + // This mode checks if the configuration resources in the policy are in + // their desired state. No actions are performed if they are not in the + // desired state. This mode is used for reporting purposes. + VALIDATION = 1; + + // This mode checks if the configuration resources in the policy are in + // their desired state, and if not, enforces the desired state. + ENFORCEMENT = 2; + } + + // Filtering criteria to select VMs based on OS details. + message OSFilter { + // This should match OS short name emitted by the OS inventory agent. + // An empty value matches any OS. + string os_short_name = 1; + + // This value should match the version emitted by the OS inventory + // agent. + // Prefix matches are supported if asterisk(*) is provided as the + // last character. For example, to match all versions with a major + // version of `7`, specify the following value for this field `7.*` + string os_version = 2; + } + + // Filtering criteria to select VMs based on inventory details. + message InventoryFilter { + // Required. The OS short name + string os_short_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The OS version + // + // Prefix matches are supported if asterisk(*) is provided as the + // last character. For example, to match all versions with a major + // version of `7`, specify the following value for this field `7.*` + // + // An empty string matches all OS versions. + string os_version = 2; + } + + // An OS policy resource is used to define the desired state configuration + // and provides a specific functionality like installing/removing packages, + // executing a script etc. + // + // The system ensures that resources are always in their desired state by + // taking necessary actions if they have drifted from their desired state. + message Resource { + // A remote or local file. + message File { + // Specifies a file available via some URI. + message Remote { + // Required. URI from which to fetch the object. It should contain both the + // protocol and path following the format `{protocol}://{location}`. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // SHA256 checksum of the remote file. + string sha256_checksum = 2; + } + + // Specifies a file available as a Cloud Storage Object. + message Gcs { + // Required. Bucket of the Cloud Storage object. + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the Cloud Storage object. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Generation number of the Cloud Storage object. + int64 generation = 3; + } + + // A specific type of file. + oneof type { + // A generic remote file. + Remote remote = 1; + + // A Cloud Storage object. + Gcs gcs = 2; + + // A local path within the VM to use. + string local_path = 3; + } + + // Defaults to false. When false, files are subject to validations + // based on the file type: + // + // Remote: A checksum must be specified. + // Cloud Storage: An object generation number must be specified. + bool allow_insecure = 4; + } + + // A resource that manages a system package. + message PackageResource { + // The desired state that the OS Config agent maintains on the VM. + enum DesiredState { + // Unspecified is invalid. + DESIRED_STATE_UNSPECIFIED = 0; + + // Ensure that the package is installed. + INSTALLED = 1; + + // The agent ensures that the package is not installed and + // uninstalls it if detected. + REMOVED = 2; + } + + // A deb package file. dpkg packages only support INSTALLED state. + message Deb { + // Required. A deb package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether dependencies should also be installed. + // - install when false: `dpkg -i package` + // - install when true: `apt-get update && apt-get -y install + // package.deb` + bool pull_deps = 2; + } + + // A package managed by APT. + // - install: `apt-get update && apt-get -y install [name]` + // - remove: `apt-get -y remove [name]` + message APT { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // An RPM package file. RPM packages only support INSTALLED state. + message RPM { + // Required. An rpm package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether dependencies should also be installed. + // - install when false: `rpm --upgrade --replacepkgs package.rpm` + // - install when true: `yum -y install package.rpm` or + // `zypper -y install package.rpm` + bool pull_deps = 2; + } + + // A package managed by YUM. + // - install: `yum -y install package` + // - remove: `yum -y remove package` + message YUM { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A package managed by Zypper. + // - install: `zypper -y install package` + // - remove: `zypper -y rm package` + message Zypper { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A package managed by GooGet. + // - install: `googet -noconfirm install package` + // - remove: `googet -noconfirm remove package` + message GooGet { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // An MSI package. MSI packages only support INSTALLED state. + message MSI { + // Required. The MSI package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Additional properties to use during installation. + // This should be in the format of Property=Setting. + // Appended to the defaults of `ACTION=INSTALL + // REBOOT=ReallySuppress`. + repeated string properties = 2; + } + + // Required. The desired state the agent should maintain for this package. + DesiredState desired_state = 1 [(google.api.field_behavior) = REQUIRED]; + + // A system package. + oneof system_package { + // A package managed by Apt. + APT apt = 2; + + // A deb package file. + Deb deb = 3; + + // A package managed by YUM. + YUM yum = 4; + + // A package managed by Zypper. + Zypper zypper = 5; + + // An rpm package file. + RPM rpm = 6; + + // A package managed by GooGet. + GooGet googet = 7; + + // An MSI package. + MSI msi = 8; + } + } + + // A resource that manages a package repository. + message RepositoryResource { + // Represents a single apt package repository. These will be added to + // a repo file that will be managed at + // `/etc/apt/sources.list.d/google_osconfig.list`. + message AptRepository { + // Type of archive. + enum ArchiveType { + // Unspecified is invalid. + ARCHIVE_TYPE_UNSPECIFIED = 0; + + // Deb indicates that the archive contains binary files. + DEB = 1; + + // Deb-src indicates that the archive contains source files. + DEB_SRC = 2; + } + + // Required. Type of archive files in this repository. + ArchiveType archive_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. URI for this repository. + string uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Distribution of this repository. + string distribution = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of components for this repository. Must contain at least one + // item. + repeated string components = 4 [(google.api.field_behavior) = REQUIRED]; + + // URI of the key file for this repository. The agent maintains a + // keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg`. + string gpg_key = 5; + } + + // Represents a single yum package repository. These are added to a + // repo file that is managed at + // `/etc/yum.repos.d/google_osconfig.repo`. + message YumRepository { + // Required. A one word, unique name for this repository. This is the `repo + // id` in the yum config file and also the `display_name` if + // `display_name` is omitted. This id is also used as the unique + // identifier when checking for resource conflicts. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the repository. + string display_name = 2; + + // Required. The location of the repository directory. + string base_url = 3 [(google.api.field_behavior) = REQUIRED]; + + // URIs of GPG keys. + repeated string gpg_keys = 4; + } + + // Represents a single zypper package repository. These are added to a + // repo file that is managed at + // `/etc/zypp/repos.d/google_osconfig.repo`. + message ZypperRepository { + // Required. A one word, unique name for this repository. This is the `repo + // id` in the zypper config file and also the `display_name` if + // `display_name` is omitted. This id is also used as the unique + // identifier when checking for GuestPolicy conflicts. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the repository. + string display_name = 2; + + // Required. The location of the repository directory. + string base_url = 3 [(google.api.field_behavior) = REQUIRED]; + + // URIs of GPG keys. + repeated string gpg_keys = 4; + } + + // Represents a Goo package repository. These are added to a repo file + // that is managed at + // `C:/ProgramData/GooGet/repos/google_osconfig.repo`. + message GooRepository { + // Required. The name of the repository. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The url of the repository. + string url = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // A specific type of repository. + oneof repository { + // An Apt Repository. + AptRepository apt = 1; + + // A Yum Repository. + YumRepository yum = 2; + + // A Zypper Repository. + ZypperRepository zypper = 3; + + // A Goo Repository. + GooRepository goo = 4; + } + } + + // A resource that allows executing scripts on the VM. + // + // The `ExecResource` has 2 stages: `validate` and `enforce` and both stages + // accept a script as an argument to execute. + // + // When the `ExecResource` is applied by the agent, it first executes the + // script in the `validate` stage. The `validate` stage can signal that the + // `ExecResource` is already in the desired state by returning an exit code + // of `100`. If the `ExecResource` is not in the desired state, it should + // return an exit code of `101`. Any other exit code returned by this stage + // is considered an error. + // + // If the `ExecResource` is not in the desired state based on the exit code + // from the `validate` stage, the agent proceeds to execute the script from + // the `enforce` stage. If the `ExecResource` is already in the desired + // state, the `enforce` stage will not be run. + // Similar to `validate` stage, the `enforce` stage should return an exit + // code of `100` to indicate that the resource in now in its desired state. + // Any other exit code is considered an error. + // + // NOTE: An exit code of `100` was chosen over `0` (and `101` vs `1`) to + // have an explicit indicator of `in desired state`, `not in desired state` + // and errors. Because, for example, Powershell will always return an exit + // code of `0` unless an `exit` statement is provided in the script. So, for + // reasons of consistency and being explicit, exit codes `100` and `101` + // were chosen. + message ExecResource { + // A file or script to execute. + message Exec { + // The interpreter to use. + enum Interpreter { + // Invalid value, the request will return validation error. + INTERPRETER_UNSPECIFIED = 0; + + // If an interpreter is not specified, the + // source is executed directly. This execution, without an + // interpreter, only succeeds for executables and scripts that have shebang lines. + NONE = 1; + + // Indicates that the script runs with `/bin/sh` on Linux and + // `cmd.exe` on Windows. + SHELL = 2; + + // Indicates that the script runs with PowerShell. + POWERSHELL = 3; + } + + // What to execute. + oneof source { + // A remote or local file. + File file = 1; + + // An inline script. + // The size of the script is limited to 1024 characters. + string script = 2; + } + + // Optional arguments to pass to the source during execution. + repeated string args = 3; + + // Required. The script interpreter to use. + Interpreter interpreter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Only recorded for enforce Exec. + // Path to an output file (that is created by this Exec) whose + // content will be recorded in OSPolicyResourceCompliance after a + // successful run. Absence or failure to read this file will result in + // this ExecResource being non-compliant. Output file size is limited to + // 100K bytes. + string output_file_path = 5; + } + + // Required. What to run to validate this resource is in the desired state. + // An exit code of 100 indicates "in desired state", and exit code of 101 + // indicates "not in desired state". Any other exit code indicates a + // failure running validate. + Exec validate = 1 [(google.api.field_behavior) = REQUIRED]; + + // What to run to bring this resource into the desired state. + // An exit code of 100 indicates "success", any other exit code indicates + // a failure running enforce. + Exec enforce = 2; + } + + // A resource that manages the state of a file. + message FileResource { + // Desired state of the file. + enum DesiredState { + // Unspecified is invalid. + DESIRED_STATE_UNSPECIFIED = 0; + + // Ensure file at path is present. + PRESENT = 1; + + // Ensure file at path is absent. + ABSENT = 2; + + // Ensure the contents of the file at path matches. If the file does + // not exist it will be created. + CONTENTS_MATCH = 3; + } + + // The source for the contents of the file. + oneof source { + // A remote or local source. + File file = 1; + + // A a file with this content. + // The size of the content is limited to 1024 characters. + string content = 2; + } + + // Required. The absolute path of the file within the VM. + string path = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Desired state of the file. + DesiredState state = 4 [(google.api.field_behavior) = REQUIRED]; + + // Consists of three octal digits which represent, in + // order, the permissions of the owner, group, and other users for the + // file (similarly to the numeric mode used in the linux chmod + // utility). Each digit represents a three bit number with the 4 bit + // corresponding to the read permissions, the 2 bit corresponds to the + // write bit, and the one bit corresponds to the execute permission. + // Default behavior is 755. + // + // Below are some examples of permissions and their associated values: + // read, write, and execute: 7 + // read and execute: 5 + // read and write: 6 + // read only: 4 + string permissions = 5; + } + + // Required. The id of the resource with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the OS policy. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Resource type. + oneof resource_type { + // Package resource + PackageResource pkg = 2; + + // Package repository resource + RepositoryResource repository = 3; + + // Exec resource + ExecResource exec = 4; + + // File resource + FileResource file = 5; + } + } + + // Resource groups provide a mechanism to group OS policy resources. + // + // Resource groups enable OS policy authors to create a single OS policy + // to be applied to VMs running different operating Systems. + // + // When the OS policy is applied to a target VM, the appropriate resource + // group within the OS policy is selected based on the `OSFilter` specified + // within the resource group. + message ResourceGroup { + // Deprecated. Use the `inventory_filters` field instead. + // Used to specify the OS filter for a resource group + OSFilter os_filter = 1 [deprecated = true]; + + // List of inventory filters for the resource group. + // + // The resources in this resource group are applied to the target VM if it + // satisfies at least one of the following inventory filters. + // + // For example, to apply this resource group to VMs running either `RHEL` or + // `CentOS` operating systems, specify 2 items for the list with following + // values: + // inventory_filters[0].os_short_name='rhel' and + // inventory_filters[1].os_short_name='centos' + // + // If the list is empty, this resource group will be applied to the target + // VM unconditionally. + repeated InventoryFilter inventory_filters = 3; + + // Required. List of resources configured for this resource group. + // The resources are executed in the exact order specified here. + repeated Resource resources = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The id of the OS policy with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the assignment. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Policy description. + // Length of the description is limited to 1024 characters. + string description = 2; + + // Required. Policy mode + Mode mode = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of resource groups for the policy. + // For a particular VM, resource groups are evaluated in the order specified + // and the first resource group that is applicable is selected and the rest + // are ignored. + // + // If none of the resource groups are applicable for a VM, the VM is + // considered to be non-compliant w.r.t this policy. This behavior can be + // toggled by the flag `allow_no_resource_group_match` + repeated ResourceGroup resource_groups = 4 [(google.api.field_behavior) = REQUIRED]; + + // This flag determines the OS policy compliance status when none of the + // resource groups within the policy are applicable for a VM. Set this value + // to `true` if the policy needs to be reported as compliant even if the + // policy has nothing to validate or enforce. + bool allow_no_resource_group_match = 5; +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/os_policy_assignment_reports.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/os_policy_assignment_reports.proto new file mode 100644 index 00000000000..87905bbf5e8 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/os_policy_assignment_reports.proto @@ -0,0 +1,296 @@ +// 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.osconfig.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OSPolicyAssignmentReportsProto"; +option java_package = "com.google.cloud.osconfig.v1alpha"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha"; +option ruby_package = "Google::Cloud::OsConfig::V1alpha"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/InstanceOSPolicyAssignment" + pattern: "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}" +}; + +// Get a report of the OS policy assignment for a VM instance. +message GetOSPolicyAssignmentReportRequest { + // Required. API resource name for OS policy assignment report. + // + // Format: + // `/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance_id}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + // For `{assignment_id}`, the OSPolicyAssignment id must be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignmentReport" + } + ]; +} + +// List the OS policy assignment reports for VM instances. +message ListOSPolicyAssignmentReportsRequest { + // Required. The parent resource name. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + // provided. If '-' is provided, the response will include + // OSPolicyAssignmentReports for all instances in the project/location. + // For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + // is provided, the response will include OSPolicyAssignmentReports for all + // OSPolicyAssignments in the project/location. + // Either {instance} or {assignment} must be `-`. + // + // For example: + // `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + // returns all reports for the instance + // `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + // returns all the reports for the given assignment across all instances. + // `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + // returns all the reports for all assignments across all instances. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/InstanceOSPolicyAssignment" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // If provided, this field specifies the criteria that must be met by the + // `OSPolicyAssignmentReport` API resource that is included in the response. + string filter = 3; + + // A pagination token returned from a previous call to the + // `ListOSPolicyAssignmentReports` method that indicates where this listing + // should continue from. + string page_token = 4; +} + +// A response message for listing OS Policy assignment reports including the +// page of results and page token. +message ListOSPolicyAssignmentReportsResponse { + // List of OS policy assignment reports. + repeated OSPolicyAssignmentReport os_policy_assignment_reports = 1; + + // The pagination token to retrieve the next page of OS policy assignment + // report objects. + string next_page_token = 2; +} + +// A report of the OS policy assignment status for a given instance. +message OSPolicyAssignmentReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/OSPolicyAssignmentReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report" + }; + + // Compliance data for an OS policy + message OSPolicyCompliance { + // Possible compliance states for an os policy. + enum ComplianceState { + // The policy is in an unknown compliance state. + // + // Refer to the field `compliance_state_reason` to learn the exact reason + // for the policy to be in this compliance state. + UNKNOWN = 0; + + // Policy is compliant. + // + // The policy is compliant if all the underlying resources are also + // compliant. + COMPLIANT = 1; + + // Policy is non-compliant. + // + // The policy is non-compliant if one or more underlying resources are + // non-compliant. + NON_COMPLIANT = 2; + } + + // Compliance data for an OS policy resource. + message OSPolicyResourceCompliance { + // Step performed by the OS Config agent for configuring an + // `OSPolicy` resource to its desired state. + message OSPolicyResourceConfigStep { + // Supported configuration step types + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // Checks for resource conflicts such as schema errors. + VALIDATION = 1; + + // Checks the current status of the desired state for a resource. + DESIRED_STATE_CHECK = 2; + + // Enforces the desired state for a resource that is not in desired + // state. + DESIRED_STATE_ENFORCEMENT = 3; + + // Re-checks the status of the desired state. This check is done + // for a resource after the enforcement of all OS policies. + // + // This step is used to determine the final desired state status for + // the resource. It accounts for any resources that might have drifted + // from their desired state due to side effects from executing other + // resources. + DESIRED_STATE_CHECK_POST_ENFORCEMENT = 4; + } + + // Configuration step type. + Type type = 1; + + // An error message recorded during the execution of this step. + // Only populated if errors were encountered during this step execution. + string error_message = 2; + } + + // Possible compliance states for a resource. + enum ComplianceState { + // The resource is in an unknown compliance state. + // + // To get more details about why the policy is in this state, review + // the output of the `compliance_state_reason` field. + UNKNOWN = 0; + + // Resource is compliant. + COMPLIANT = 1; + + // Resource is non-compliant. + NON_COMPLIANT = 2; + } + + // ExecResource specific output. + message ExecResourceOutput { + // Output from enforcement phase output file (if run). + // Output size is limited to 100K bytes. + bytes enforcement_output = 2; + } + + // The ID of the OS policy resource. + string os_policy_resource_id = 1; + + // Ordered list of configuration completed by the agent for the OS policy + // resource. + repeated OSPolicyResourceConfigStep config_steps = 2; + + // The compliance state of the resource. + ComplianceState compliance_state = 3; + + // A reason for the resource to be in the given compliance state. + // This field is always populated when `compliance_state` is `UNKNOWN`. + // + // The following values are supported when `compliance_state == UNKNOWN` + // + // * `execution-errors`: Errors were encountered by the agent while + // executing the resource and the compliance state couldn't be + // determined. + // * `execution-skipped-by-agent`: Resource execution was skipped by the + // agent because errors were encountered while executing prior resources + // in the OS policy. + // * `os-policy-execution-attempt-failed`: The execution of the OS policy + // containing this resource failed and the compliance state couldn't be + // determined. + string compliance_state_reason = 4; + + // Resource specific output. + oneof output { + // ExecResource specific output. + ExecResourceOutput exec_resource_output = 5; + } + } + + // The OS policy id + string os_policy_id = 1; + + // The compliance state of the OS policy. + ComplianceState compliance_state = 2; + + // The reason for the OS policy to be in an unknown compliance state. + // This field is always populated when `compliance_state` is `UNKNOWN`. + // + // If populated, the field can contain one of the following values: + // + // * `vm-not-running`: The VM was not running. + // * `os-policies-not-supported-by-agent`: The version of the OS Config + // agent running on the VM does not support running OS policies. + // * `no-agent-detected`: The OS Config agent is not detected for the VM. + // * `resource-execution-errors`: The OS Config agent encountered errors + // while executing one or more resources in the policy. See + // `os_policy_resource_compliances` for details. + // * `task-timeout`: The task sent to the agent to apply the policy timed + // out. + // * `unexpected-agent-state`: The OS Config agent did not report the final + // status of the task that attempted to apply the policy. Instead, the agent + // unexpectedly started working on a different task. This mostly happens + // when the agent or VM unexpectedly restarts while applying OS policies. + // * `internal-service-errors`: Internal service errors were encountered + // while attempting to apply the policy. + string compliance_state_reason = 3; + + // Compliance data for each resource within the policy that is applied to + // the VM. + repeated OSPolicyResourceCompliance os_policy_resource_compliances = 4; + } + + // The `OSPolicyAssignmentReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/osPolicyAssignments/{os_policy_assignment_id}/report` + string name = 1; + + // The Compute Engine VM instance name. + string instance = 2; + + // Reference to the `OSPolicyAssignment` API resource that the `OSPolicy` + // belongs to. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` + string os_policy_assignment = 3 [(google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + }]; + + // Compliance data for each `OSPolicy` that is applied to the VM. + repeated OSPolicyCompliance os_policy_compliances = 4; + + // Timestamp for when the report was last generated. + google.protobuf.Timestamp update_time = 5; + + // Unique identifier of the last attempted run to apply the OS policies + // associated with this assignment on the VM. + // + // This ID is logged by the OS Config agent while applying the OS + // policies associated with this assignment on the VM. + // NOTE: If the service is unable to successfully connect to the agent for + // this run, then this id will not be available in the agent logs. + string last_run_id = 6; +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/os_policy_assignments.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/os_policy_assignments.proto new file mode 100644 index 00000000000..30106569fb8 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/os_policy_assignments.proto @@ -0,0 +1,383 @@ +// 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.osconfig.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1alpha/os_policy.proto"; +import "google/cloud/osconfig/v1alpha/osconfig_common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OsPolicyAssignmentsProto"; +option java_package = "com.google.cloud.osconfig.v1alpha"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha"; +option ruby_package = "Google::Cloud::OsConfig::V1alpha"; + +// OS policy assignment is an API resource that is used to +// apply a set of OS policies to a dynamically targeted group of Compute Engine +// VM instances. +// +// An OS policy is used to define the desired state configuration for a +// Compute Engine VM instance through a set of configuration resources that +// provide capabilities such as installing or removing software packages, or +// executing a script. +// +// For more information, see [OS policy and OS policy +// assignment](https://cloud.google.com/compute/docs/os-configuration-management/working-with-os-policies). +message OSPolicyAssignment { + option (google.api.resource) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + pattern: "projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}" + }; + + // Message representing label set. + // * A label is a key value pair set for a VM. + // * A LabelSet is a set of labels. + // * Labels within a LabelSet are ANDed. In other words, a LabelSet is + // applicable for a VM only if it matches all the labels in the + // LabelSet. + // * Example: A LabelSet with 2 labels: `env=prod` and `type=webserver` will + // only be applicable for those VMs with both labels + // present. + message LabelSet { + // Labels are identified by key/value pairs in this map. + // A VM should contain all the key/value pairs specified in this + // map to be selected. + map labels = 1; + } + + // Filters to select target VMs for an assignment. + // + // If more than one filter criteria is specified below, a VM will be selected + // if and only if it satisfies all of them. + message InstanceFilter { + // VM inventory details. + message Inventory { + // Required. The OS short name + string os_short_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The OS version + // + // Prefix matches are supported if asterisk(*) is provided as the + // last character. For example, to match all versions with a major + // version of `7`, specify the following value for this field `7.*` + // + // An empty string matches all OS versions. + string os_version = 2; + } + + // Target all VMs in the project. If true, no other criteria is + // permitted. + bool all = 1; + + // Deprecated. Use the `inventories` field instead. + // A VM is selected if it's OS short name matches with any of the + // values provided in this list. + repeated string os_short_names = 2 [deprecated = true]; + + // List of label sets used for VM inclusion. + // + // If the list has more than one `LabelSet`, the VM is included if any + // of the label sets are applicable for the VM. + repeated LabelSet inclusion_labels = 3; + + // List of label sets used for VM exclusion. + // + // If the list has more than one label set, the VM is excluded if any + // of the label sets are applicable for the VM. + repeated LabelSet exclusion_labels = 4; + + // List of inventories to select VMs. + // + // A VM is selected if its inventory data matches at least one of the + // following inventories. + repeated Inventory inventories = 5; + } + + // Message to configure the rollout at the zonal level for the OS policy + // assignment. + message Rollout { + // Required. The maximum number (or percentage) of VMs per zone to disrupt at + // any given moment. + FixedOrPercent disruption_budget = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. This determines the minimum duration of time to wait after the + // configuration changes are applied through the current rollout. A + // VM continues to count towards the `disruption_budget` at least + // until this duration of time has passed after configuration changes are + // applied. + google.protobuf.Duration min_wait_duration = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // OS policy assignment rollout state + enum RolloutState { + // Invalid value + ROLLOUT_STATE_UNSPECIFIED = 0; + + // The rollout is in progress. + IN_PROGRESS = 1; + + // The rollout is being cancelled. + CANCELLING = 2; + + // The rollout is cancelled. + CANCELLED = 3; + + // The rollout has completed successfully. + SUCCEEDED = 4; + } + + // Resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id}` + // + // This field is ignored when you create an OS policy assignment. + string name = 1; + + // OS policy assignment description. + // Length of the description is limited to 1024 characters. + string description = 2; + + // Required. List of OS policies to be applied to the VMs. + repeated OSPolicy os_policies = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Filter to select VMs. + InstanceFilter instance_filter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Rollout to deploy the OS policy assignment. + // A rollout is triggered in the following situations: + // 1) OSPolicyAssignment is created. + // 2) OSPolicyAssignment is updated and the update contains changes to one of + // the following fields: + // - instance_filter + // - os_policies + // 3) OSPolicyAssignment is deleted. + Rollout rollout = 5 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The assignment revision ID + // A new revision is committed whenever a rollout is triggered for a OS policy + // assignment + string revision_id = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp that the revision was created. + google.protobuf.Timestamp revision_create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The etag for this OS policy assignment. + // If this is provided on update, it must match the server's etag. + string etag = 8; + + // Output only. OS policy assignment rollout state + RolloutState rollout_state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that this revision has been successfully rolled out in this zone + // and new VMs will be assigned OS policies from this revision. + // + // For a given OS policy assignment, there is only one revision with a value + // of `true` for this field. + bool baseline = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that this revision deletes the OS policy assignment. + bool deleted = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that reconciliation is in progress for the revision. + // This value is `true` when the `rollout_state` is one of: + // * IN_PROGRESS + // * CANCELLING + bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server generated unique id for the OS policy assignment resource. + string uid = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// OS policy assignment operation metadata provided by OS policy assignment API +// methods that return long running operations. +message OSPolicyAssignmentOperationMetadata { + // The OS policy assignment API method. + enum APIMethod { + // Invalid value + API_METHOD_UNSPECIFIED = 0; + + // Create OS policy assignment API method + CREATE = 1; + + // Update OS policy assignment API method + UPDATE = 2; + + // Delete OS policy assignment API method + DELETE = 3; + } + + // State of the rollout + enum RolloutState { + // Invalid value + ROLLOUT_STATE_UNSPECIFIED = 0; + + // The rollout is in progress. + IN_PROGRESS = 1; + + // The rollout is being cancelled. + CANCELLING = 2; + + // The rollout is cancelled. + CANCELLED = 3; + + // The rollout has completed successfully. + SUCCEEDED = 4; + } + + // Reference to the `OSPolicyAssignment` API resource. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` + string os_policy_assignment = 1 [(google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + }]; + + // The OS policy assignment API method. + APIMethod api_method = 2; + + // State of the rollout + RolloutState rollout_state = 3; + + // Rollout start time + google.protobuf.Timestamp rollout_start_time = 4; + + // Rollout update time + google.protobuf.Timestamp rollout_update_time = 5; +} + +// A request message to create an OS policy assignment +message CreateOSPolicyAssignmentRequest { + // Required. The parent resource name in the form: + // projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The OS policy assignment to be created. + OSPolicyAssignment os_policy_assignment = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The logical name of the OS policy assignment in the project + // with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the project. + string os_policy_assignment_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A request message to update an OS policy assignment +message UpdateOSPolicyAssignmentRequest { + // Required. The updated OS policy assignment. + OSPolicyAssignment os_policy_assignment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask that controls which fields of the assignment should be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message to get an OS policy assignment +message GetOSPolicyAssignmentRequest { + // Required. The resource name of OS policy assignment. + // + // Format: + // `projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}@{revisionId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; +} + +// A request message to list OS policy assignments for a parent resource +message ListOSPolicyAssignmentsRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of assignments to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListOSPolicyAssignments` that indicates where this listing should continue + // from. + string page_token = 3; +} + +// A response message for listing all assignments under given parent. +message ListOSPolicyAssignmentsResponse { + // The list of assignments + repeated OSPolicyAssignment os_policy_assignments = 1; + + // The pagination token to retrieve the next page of OS policy assignments. + string next_page_token = 2; +} + +// A request message to list revisions for a OS policy assignment +message ListOSPolicyAssignmentRevisionsRequest { + // Required. The name of the OS policy assignment to list revisions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; + + // The maximum number of revisions to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListOSPolicyAssignmentRevisions` that indicates where this listing should + // continue from. + string page_token = 3; +} + +// A response message for listing all revisions for a OS policy assignment. +message ListOSPolicyAssignmentRevisionsResponse { + // The OS policy assignment revisions + repeated OSPolicyAssignment os_policy_assignments = 1; + + // The pagination token to retrieve the next page of OS policy assignment + // revisions. + string next_page_token = 2; +} + +// A request message for deleting a OS policy assignment. +message DeleteOSPolicyAssignmentRequest { + // Required. The name of the OS policy assignment to be deleted + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/osconfig_common.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/osconfig_common.proto new file mode 100644 index 00000000000..1d2b58ac6cd --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/osconfig_common.proto @@ -0,0 +1,40 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.osconfig.v1alpha; + + +option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "Common"; +option java_package = "com.google.cloud.osconfig.v1alpha"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha"; +option ruby_package = "Google::Cloud::OsConfig::V1alpha"; + +// Message encapsulating a value that can be either absolute ("fixed") or +// relative ("percent") to a value. +message FixedOrPercent { + // Type of the value. + oneof mode { + // Specifies a fixed value. + int32 fixed = 1; + + // Specifies the relative value defined as a percentage, which will be + // multiplied by a reference value. + int32 percent = 2; + } +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/osconfig_zonal_service.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/osconfig_zonal_service.proto new file mode 100644 index 00000000000..bb73fbd0331 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/osconfig_zonal_service.proto @@ -0,0 +1,215 @@ +// 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.osconfig.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1alpha/instance_os_policies_compliance.proto"; +import "google/cloud/osconfig/v1alpha/inventory.proto"; +import "google/cloud/osconfig/v1alpha/os_policy_assignment_reports.proto"; +import "google/cloud/osconfig/v1alpha/os_policy_assignments.proto"; +import "google/cloud/osconfig/v1alpha/vulnerability.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OsConfigZonalServiceProto"; +option java_package = "com.google.cloud.osconfig.v1alpha"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha"; +option ruby_package = "Google::Cloud::OsConfig::V1alpha"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" +}; + +// Zonal OS Config API +// +// The OS Config service is the server-side component that allows users to +// manage package installations and patch jobs for Compute Engine VM instances. +service OsConfigZonalService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Create an OS policy assignment. + // + // This method also creates the first revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel). + rpc CreateOSPolicyAssignment(CreateOSPolicyAssignmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/osPolicyAssignments" + body: "os_policy_assignment" + }; + option (google.api.method_signature) = "parent,os_policy_assignment,os_policy_assignment_id"; + option (google.longrunning.operation_info) = { + response_type: "OSPolicyAssignment" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Update an existing OS policy assignment. + // + // This method creates a new revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel). + rpc UpdateOSPolicyAssignment(UpdateOSPolicyAssignmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{os_policy_assignment.name=projects/*/locations/*/osPolicyAssignments/*}" + body: "os_policy_assignment" + }; + option (google.api.method_signature) = "os_policy_assignment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "OSPolicyAssignment" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Retrieve an existing OS policy assignment. + // + // This method always returns the latest revision. In order to retrieve a + // previous revision of the assignment, also provide the revision ID in the + // `name` parameter. + rpc GetOSPolicyAssignment(GetOSPolicyAssignmentRequest) returns (OSPolicyAssignment) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List the OS policy assignments under the parent resource. + // + // For each OS policy assignment, the latest revision is returned. + rpc ListOSPolicyAssignments(ListOSPolicyAssignmentsRequest) returns (ListOSPolicyAssignmentsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/osPolicyAssignments" + }; + option (google.api.method_signature) = "parent"; + } + + // List the OS policy assignment revisions for a given OS policy assignment. + rpc ListOSPolicyAssignmentRevisions(ListOSPolicyAssignmentRevisionsRequest) returns (ListOSPolicyAssignmentRevisionsResponse) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}:listRevisions" + }; + option (google.api.method_signature) = "name"; + } + + // Delete the OS policy assignment. + // + // This method creates a new revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // If the LRO completes and is not cancelled, all revisions associated with + // the OS policy assignment are deleted. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel). + rpc DeleteOSPolicyAssignment(DeleteOSPolicyAssignmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Get OS policies compliance data for the specified Compute Engine VM + // instance. + rpc GetInstanceOSPoliciesCompliance(GetInstanceOSPoliciesComplianceRequest) returns (InstanceOSPoliciesCompliance) { + option deprecated = true; + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/instanceOSPoliciesCompliances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List OS policies compliance data for all Compute Engine VM instances in the + // specified zone. + rpc ListInstanceOSPoliciesCompliances(ListInstanceOSPoliciesCompliancesRequest) returns (ListInstanceOSPoliciesCompliancesResponse) { + option deprecated = true; + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/instanceOSPoliciesCompliances" + }; + option (google.api.method_signature) = "parent"; + } + + // Get the OS policy asssignment report for the specified Compute Engine VM + // instance. + rpc GetOSPolicyAssignmentReport(GetOSPolicyAssignmentReportRequest) returns (OSPolicyAssignmentReport) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/instances/*/osPolicyAssignments/*/report}" + }; + option (google.api.method_signature) = "name"; + } + + // List OS policy asssignment reports for all Compute Engine VM instances in + // the specified zone. + rpc ListOSPolicyAssignmentReports(ListOSPolicyAssignmentReportsRequest) returns (ListOSPolicyAssignmentReportsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/instances/*/osPolicyAssignments/*}/reports" + }; + option (google.api.method_signature) = "parent"; + } + + // Get inventory data for the specified VM instance. If the VM has no + // associated inventory, the message `NOT_FOUND` is returned. + rpc GetInventory(GetInventoryRequest) returns (Inventory) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/instances/*/inventory}" + }; + option (google.api.method_signature) = "name"; + } + + // List inventory data for all VM instances in the specified zone. + rpc ListInventories(ListInventoriesRequest) returns (ListInventoriesResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/instances/*}/inventories" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the vulnerability report for the specified VM instance. Only VMs with + // inventory data have vulnerability reports associated with them. + rpc GetVulnerabilityReport(GetVulnerabilityReportRequest) returns (VulnerabilityReport) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/instances/*/vulnerabilityReport}" + }; + option (google.api.method_signature) = "name"; + } + + // List vulnerability reports for all VM instances in the specified zone. + rpc ListVulnerabilityReports(ListVulnerabilityReportsRequest) returns (ListVulnerabilityReportsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports" + }; + option (google.api.method_signature) = "parent"; + } +} diff --git a/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/vulnerability.proto b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/vulnerability.proto new file mode 100644 index 00000000000..54080ba759d --- /dev/null +++ b/packages/google-cloud-osconfig/protos/google/cloud/osconfig/v1alpha/vulnerability.proto @@ -0,0 +1,365 @@ +// 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.osconfig.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "VulnerabilityProto"; +option java_package = "com.google.cloud.osconfig.v1alpha"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha"; +option ruby_package = "Google::Cloud::OsConfig::V1alpha"; + +// This API resource represents the vulnerability report for a specified +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// For more information, see [Vulnerability +// reports](https://cloud.google.com/compute/docs/instances/os-inventory-management#vulnerability-reports). +message VulnerabilityReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport" + }; + + // A vulnerability affecting the VM instance. + message Vulnerability { + // Contains metadata information for the vulnerability. This information is + // collected from the upstream feed of the operating system. + message Details { + // A reference for this vulnerability. + message Reference { + // The url of the reference. + string url = 1; + + // The source of the reference e.g. NVD. + string source = 2; + } + + // The CVE of the vulnerability. CVE cannot be + // empty and the combination of should be unique + // across vulnerabilities for a VM. + string cve = 1; + + // The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of + // 0 - 10 where 0 indicates low severity and 10 indicates high severity. + float cvss_v2_score = 2; + + // The full description of the CVSSv3 for this vulnerability from NVD. + CVSSv3 cvss_v3 = 3; + + // Assigned severity/impact ranking from the distro. + string severity = 4; + + // The note or description describing the vulnerability from the distro. + string description = 5; + + // Corresponds to the references attached to the `VulnerabilityDetails`. + repeated Reference references = 6; + } + + // OS inventory item that is affected by a vulnerability or fixed as a + // result of a vulnerability. + message Item { + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some + // operating systems, this field might be empty. + string installed_inventory_item_id = 1; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + string available_inventory_item_id = 2; + + // The recommended [CPE URI](https://cpe.mitre.org/specification/) update + // that contains a fix for this vulnerability. + string fixed_cpe_uri = 3; + + // The upstream OS patch, packages or KB that fixes the vulnerability. + string upstream_fix = 4; + } + + // Contains metadata as per the upstream feed of the operating system and + // NVD. + Details details = 1; + + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some distros, + // this field may be empty. + repeated string installed_inventory_item_ids = 2 [deprecated = true]; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + repeated string available_inventory_item_ids = 3 [deprecated = true]; + + // The timestamp for when the vulnerability was first detected. + google.protobuf.Timestamp create_time = 4; + + // The timestamp for when the vulnerability was last modified. + google.protobuf.Timestamp update_time = 5; + + // List of items affected by the vulnerability. + repeated Item items = 6; + } + + // Output only. The `vulnerabilityReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of vulnerabilities affecting the VM. + repeated Vulnerability vulnerabilities = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp for when the last vulnerability report was generated for the + // VM. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting the vulnerability report for the specified VM. +message GetVulnerabilityReportRequest { + // Required. API resource name for vulnerability resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + } + ]; +} + +// A request message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListVulnerabilityReports` that indicates where this listing + // should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by a + // `vulnerabilityReport` API resource to be included in the response. + string filter = 4; +} + +// A response message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsResponse { + // List of vulnerabilityReport objects. + repeated VulnerabilityReport vulnerability_reports = 1; + + // The pagination token to retrieve the next page of vulnerabilityReports + // object. + string next_page_token = 2; +} + +// Common Vulnerability Scoring System version 3. +// For details, see https://www.first.org/cvss/specification-document +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. + // https://www.first.org/cvss/specification-document#Base-Metrics + float base_score = 1; + + // The Exploitability sub-score equation is derived from the Base + // Exploitability metrics. + // https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics + float exploitability_score = 2; + + // The Impact sub-score equation is derived from the Base Impact metrics. + float impact_score = 3; + + // 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-osconfig/protos/protos.d.ts b/packages/google-cloud-osconfig/protos/protos.d.ts new file mode 100644 index 00000000000..bad4c5cc71d --- /dev/null +++ b/packages/google-cloud-osconfig/protos/protos.d.ts @@ -0,0 +1,28173 @@ +// 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 osconfig. */ + namespace osconfig { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an Inventory. */ + interface IInventory { + + /** Inventory name */ + name?: (string|null); + + /** Inventory osInfo */ + osInfo?: (google.cloud.osconfig.v1.Inventory.IOsInfo|null); + + /** Inventory items */ + items?: ({ [k: string]: google.cloud.osconfig.v1.Inventory.IItem }|null); + + /** Inventory updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Inventory. */ + class Inventory implements IInventory { + + /** + * Constructs a new Inventory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IInventory); + + /** Inventory name. */ + public name: string; + + /** Inventory osInfo. */ + public osInfo?: (google.cloud.osconfig.v1.Inventory.IOsInfo|null); + + /** Inventory items. */ + public items: { [k: string]: google.cloud.osconfig.v1.Inventory.IItem }; + + /** Inventory updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Inventory instance using the specified properties. + * @param [properties] Properties to set + * @returns Inventory instance + */ + public static create(properties?: google.cloud.osconfig.v1.IInventory): google.cloud.osconfig.v1.Inventory; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.Inventory; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.Inventory; + + /** + * Verifies an Inventory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Inventory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Inventory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @param message Inventory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Inventory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Inventory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Inventory { + + /** Properties of an OsInfo. */ + interface IOsInfo { + + /** OsInfo hostname */ + hostname?: (string|null); + + /** OsInfo longName */ + longName?: (string|null); + + /** OsInfo shortName */ + shortName?: (string|null); + + /** OsInfo version */ + version?: (string|null); + + /** OsInfo architecture */ + architecture?: (string|null); + + /** OsInfo kernelVersion */ + kernelVersion?: (string|null); + + /** OsInfo kernelRelease */ + kernelRelease?: (string|null); + + /** OsInfo osconfigAgentVersion */ + osconfigAgentVersion?: (string|null); + } + + /** Represents an OsInfo. */ + class OsInfo implements IOsInfo { + + /** + * Constructs a new OsInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IOsInfo); + + /** OsInfo hostname. */ + public hostname: string; + + /** OsInfo longName. */ + public longName: string; + + /** OsInfo shortName. */ + public shortName: string; + + /** OsInfo version. */ + public version: string; + + /** OsInfo architecture. */ + public architecture: string; + + /** OsInfo kernelVersion. */ + public kernelVersion: string; + + /** OsInfo kernelRelease. */ + public kernelRelease: string; + + /** OsInfo osconfigAgentVersion. */ + public osconfigAgentVersion: string; + + /** + * Creates a new OsInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OsInfo instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IOsInfo): google.cloud.osconfig.v1.Inventory.OsInfo; + + /** + * Encodes the specified OsInfo message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @param message OsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IOsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OsInfo message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @param message OsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IOsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OsInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.Inventory.OsInfo; + + /** + * Decodes an OsInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.Inventory.OsInfo; + + /** + * Verifies an OsInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OsInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OsInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.OsInfo; + + /** + * Creates a plain object from an OsInfo message. Also converts values to other types if specified. + * @param message OsInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.OsInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OsInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OsInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Item. */ + interface IItem { + + /** Item id */ + id?: (string|null); + + /** Item originType */ + originType?: (google.cloud.osconfig.v1.Inventory.Item.OriginType|keyof typeof google.cloud.osconfig.v1.Inventory.Item.OriginType|null); + + /** Item createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Item updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Item type */ + type?: (google.cloud.osconfig.v1.Inventory.Item.Type|keyof typeof google.cloud.osconfig.v1.Inventory.Item.Type|null); + + /** Item installedPackage */ + installedPackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + + /** Item availablePackage */ + availablePackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + } + + /** Represents an Item. */ + class Item implements IItem { + + /** + * Constructs a new Item. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IItem); + + /** Item id. */ + public id: string; + + /** Item originType. */ + public originType: (google.cloud.osconfig.v1.Inventory.Item.OriginType|keyof typeof google.cloud.osconfig.v1.Inventory.Item.OriginType); + + /** Item createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Item updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Item type. */ + public type: (google.cloud.osconfig.v1.Inventory.Item.Type|keyof typeof google.cloud.osconfig.v1.Inventory.Item.Type); + + /** Item installedPackage. */ + public installedPackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + + /** Item availablePackage. */ + public availablePackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + + /** Item details. */ + public details?: ("installedPackage"|"availablePackage"); + + /** + * Creates a new Item instance using the specified properties. + * @param [properties] Properties to set + * @returns Item instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IItem): google.cloud.osconfig.v1.Inventory.Item; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Item message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.Inventory.Item; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.Inventory.Item; + + /** + * Verifies an Item message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Item + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.Item; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @param message Item + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Item to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Item + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Item { + + /** OriginType enum. */ + enum OriginType { + ORIGIN_TYPE_UNSPECIFIED = 0, + INVENTORY_REPORT = 1 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + INSTALLED_PACKAGE = 1, + AVAILABLE_PACKAGE = 2 + } + } + + /** Properties of a SoftwarePackage. */ + interface ISoftwarePackage { + + /** SoftwarePackage yumPackage */ + yumPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage aptPackage */ + aptPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPackage */ + zypperPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage googetPackage */ + googetPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPatch */ + zypperPatch?: (google.cloud.osconfig.v1.Inventory.IZypperPatch|null); + + /** SoftwarePackage wuaPackage */ + wuaPackage?: (google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null); + + /** SoftwarePackage qfePackage */ + qfePackage?: (google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null); + + /** SoftwarePackage cosPackage */ + cosPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage windowsApplication */ + windowsApplication?: (google.cloud.osconfig.v1.Inventory.IWindowsApplication|null); + } + + /** Represents a SoftwarePackage. */ + class SoftwarePackage implements ISoftwarePackage { + + /** + * Constructs a new SoftwarePackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.ISoftwarePackage); + + /** SoftwarePackage yumPackage. */ + public yumPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage aptPackage. */ + public aptPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPackage. */ + public zypperPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage googetPackage. */ + public googetPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPatch. */ + public zypperPatch?: (google.cloud.osconfig.v1.Inventory.IZypperPatch|null); + + /** SoftwarePackage wuaPackage. */ + public wuaPackage?: (google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null); + + /** SoftwarePackage qfePackage. */ + public qfePackage?: (google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null); + + /** SoftwarePackage cosPackage. */ + public cosPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage windowsApplication. */ + public windowsApplication?: (google.cloud.osconfig.v1.Inventory.IWindowsApplication|null); + + /** SoftwarePackage details. */ + public details?: ("yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|"windowsApplication"); + + /** + * Creates a new SoftwarePackage instance using the specified properties. + * @param [properties] Properties to set + * @returns SoftwarePackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.ISoftwarePackage): google.cloud.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Encodes the specified SoftwarePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @param message SoftwarePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.ISoftwarePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SoftwarePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @param message SoftwarePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.ISoftwarePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Verifies a SoftwarePackage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SoftwarePackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SoftwarePackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Creates a plain object from a SoftwarePackage message. Also converts values to other types if specified. + * @param message SoftwarePackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.SoftwarePackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SoftwarePackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SoftwarePackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VersionedPackage. */ + interface IVersionedPackage { + + /** VersionedPackage packageName */ + packageName?: (string|null); + + /** VersionedPackage architecture */ + architecture?: (string|null); + + /** VersionedPackage version */ + version?: (string|null); + } + + /** Represents a VersionedPackage. */ + class VersionedPackage implements IVersionedPackage { + + /** + * Constructs a new VersionedPackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IVersionedPackage); + + /** VersionedPackage packageName. */ + public packageName: string; + + /** VersionedPackage architecture. */ + public architecture: string; + + /** VersionedPackage version. */ + public version: string; + + /** + * Creates a new VersionedPackage instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionedPackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IVersionedPackage): google.cloud.osconfig.v1.Inventory.VersionedPackage; + + /** + * Encodes the specified VersionedPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @param message VersionedPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IVersionedPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionedPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @param message VersionedPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IVersionedPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.Inventory.VersionedPackage; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.Inventory.VersionedPackage; + + /** + * Verifies a VersionedPackage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VersionedPackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionedPackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.VersionedPackage; + + /** + * Creates a plain object from a VersionedPackage message. Also converts values to other types if specified. + * @param message VersionedPackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.VersionedPackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionedPackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VersionedPackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ZypperPatch. */ + interface IZypperPatch { + + /** ZypperPatch patchName */ + patchName?: (string|null); + + /** ZypperPatch category */ + category?: (string|null); + + /** ZypperPatch severity */ + severity?: (string|null); + + /** ZypperPatch summary */ + summary?: (string|null); + } + + /** Represents a ZypperPatch. */ + class ZypperPatch implements IZypperPatch { + + /** + * Constructs a new ZypperPatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch); + + /** ZypperPatch patchName. */ + public patchName: string; + + /** ZypperPatch category. */ + public category: string; + + /** ZypperPatch severity. */ + public severity: string; + + /** ZypperPatch summary. */ + public summary: string; + + /** + * Creates a new ZypperPatch instance using the specified properties. + * @param [properties] Properties to set + * @returns ZypperPatch instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch): google.cloud.osconfig.v1.Inventory.ZypperPatch; + + /** + * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @param message ZypperPatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @param message ZypperPatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZypperPatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.Inventory.ZypperPatch; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZypperPatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.Inventory.ZypperPatch; + + /** + * Verifies a ZypperPatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ZypperPatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZypperPatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.ZypperPatch; + + /** + * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. + * @param message ZypperPatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.ZypperPatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZypperPatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ZypperPatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WindowsUpdatePackage. */ + interface IWindowsUpdatePackage { + + /** WindowsUpdatePackage title */ + title?: (string|null); + + /** WindowsUpdatePackage description */ + description?: (string|null); + + /** WindowsUpdatePackage categories */ + categories?: (google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory[]|null); + + /** WindowsUpdatePackage kbArticleIds */ + kbArticleIds?: (string[]|null); + + /** WindowsUpdatePackage supportUrl */ + supportUrl?: (string|null); + + /** WindowsUpdatePackage moreInfoUrls */ + moreInfoUrls?: (string[]|null); + + /** WindowsUpdatePackage updateId */ + updateId?: (string|null); + + /** WindowsUpdatePackage revisionNumber */ + revisionNumber?: (number|null); + + /** WindowsUpdatePackage lastDeploymentChangeTime */ + lastDeploymentChangeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a WindowsUpdatePackage. */ + class WindowsUpdatePackage implements IWindowsUpdatePackage { + + /** + * Constructs a new WindowsUpdatePackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage); + + /** WindowsUpdatePackage title. */ + public title: string; + + /** WindowsUpdatePackage description. */ + public description: string; + + /** WindowsUpdatePackage categories. */ + public categories: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory[]; + + /** WindowsUpdatePackage kbArticleIds. */ + public kbArticleIds: string[]; + + /** WindowsUpdatePackage supportUrl. */ + public supportUrl: string; + + /** WindowsUpdatePackage moreInfoUrls. */ + public moreInfoUrls: string[]; + + /** WindowsUpdatePackage updateId. */ + public updateId: string; + + /** WindowsUpdatePackage revisionNumber. */ + public revisionNumber: number; + + /** WindowsUpdatePackage lastDeploymentChangeTime. */ + public lastDeploymentChangeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new WindowsUpdatePackage instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsUpdatePackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Encodes the specified WindowsUpdatePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @param message WindowsUpdatePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsUpdatePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @param message WindowsUpdatePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsUpdatePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsUpdatePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Verifies a WindowsUpdatePackage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsUpdatePackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Creates a plain object from a WindowsUpdatePackage message. Also converts values to other types if specified. + * @param message WindowsUpdatePackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsUpdatePackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsUpdatePackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WindowsUpdatePackage { + + /** Properties of a WindowsUpdateCategory. */ + interface IWindowsUpdateCategory { + + /** WindowsUpdateCategory id */ + id?: (string|null); + + /** WindowsUpdateCategory name */ + name?: (string|null); + } + + /** Represents a WindowsUpdateCategory. */ + class WindowsUpdateCategory implements IWindowsUpdateCategory { + + /** + * Constructs a new WindowsUpdateCategory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory); + + /** WindowsUpdateCategory id. */ + public id: string; + + /** WindowsUpdateCategory name. */ + public name: string; + + /** + * Creates a new WindowsUpdateCategory instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsUpdateCategory instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Encodes the specified WindowsUpdateCategory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @param message WindowsUpdateCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsUpdateCategory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @param message WindowsUpdateCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Verifies a WindowsUpdateCategory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WindowsUpdateCategory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsUpdateCategory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Creates a plain object from a WindowsUpdateCategory message. Also converts values to other types if specified. + * @param message WindowsUpdateCategory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsUpdateCategory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsUpdateCategory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a WindowsQuickFixEngineeringPackage. */ + interface IWindowsQuickFixEngineeringPackage { + + /** WindowsQuickFixEngineeringPackage caption */ + caption?: (string|null); + + /** WindowsQuickFixEngineeringPackage description */ + description?: (string|null); + + /** WindowsQuickFixEngineeringPackage hotFixId */ + hotFixId?: (string|null); + + /** WindowsQuickFixEngineeringPackage installTime */ + installTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a WindowsQuickFixEngineeringPackage. */ + class WindowsQuickFixEngineeringPackage implements IWindowsQuickFixEngineeringPackage { + + /** + * Constructs a new WindowsQuickFixEngineeringPackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage); + + /** WindowsQuickFixEngineeringPackage caption. */ + public caption: string; + + /** WindowsQuickFixEngineeringPackage description. */ + public description: string; + + /** WindowsQuickFixEngineeringPackage hotFixId. */ + public hotFixId: string; + + /** WindowsQuickFixEngineeringPackage installTime. */ + public installTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new WindowsQuickFixEngineeringPackage instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsQuickFixEngineeringPackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage): google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @param message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @param message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Verifies a WindowsQuickFixEngineeringPackage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WindowsQuickFixEngineeringPackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsQuickFixEngineeringPackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Creates a plain object from a WindowsQuickFixEngineeringPackage message. Also converts values to other types if specified. + * @param message WindowsQuickFixEngineeringPackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsQuickFixEngineeringPackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsQuickFixEngineeringPackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WindowsApplication. */ + interface IWindowsApplication { + + /** WindowsApplication displayName */ + displayName?: (string|null); + + /** WindowsApplication displayVersion */ + displayVersion?: (string|null); + + /** WindowsApplication publisher */ + publisher?: (string|null); + + /** WindowsApplication installDate */ + installDate?: (google.type.IDate|null); + + /** WindowsApplication helpLink */ + helpLink?: (string|null); + } + + /** Represents a WindowsApplication. */ + class WindowsApplication implements IWindowsApplication { + + /** + * Constructs a new WindowsApplication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IWindowsApplication); + + /** WindowsApplication displayName. */ + public displayName: string; + + /** WindowsApplication displayVersion. */ + public displayVersion: string; + + /** WindowsApplication publisher. */ + public publisher: string; + + /** WindowsApplication installDate. */ + public installDate?: (google.type.IDate|null); + + /** WindowsApplication helpLink. */ + public helpLink: string; + + /** + * Creates a new WindowsApplication instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsApplication instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IWindowsApplication): google.cloud.osconfig.v1.Inventory.WindowsApplication; + + /** + * Encodes the specified WindowsApplication message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @param message WindowsApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IWindowsApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsApplication message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @param message WindowsApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IWindowsApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.Inventory.WindowsApplication; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.Inventory.WindowsApplication; + + /** + * Verifies a WindowsApplication message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WindowsApplication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsApplication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsApplication; + + /** + * Creates a plain object from a WindowsApplication message. Also converts values to other types if specified. + * @param message WindowsApplication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsApplication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsApplication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsApplication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GetInventoryRequest. */ + interface IGetInventoryRequest { + + /** GetInventoryRequest name */ + name?: (string|null); + + /** GetInventoryRequest view */ + view?: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView|null); + } + + /** Represents a GetInventoryRequest. */ + class GetInventoryRequest implements IGetInventoryRequest { + + /** + * Constructs a new GetInventoryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IGetInventoryRequest); + + /** GetInventoryRequest name. */ + public name: string; + + /** GetInventoryRequest view. */ + public view: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView); + + /** + * Creates a new GetInventoryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInventoryRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IGetInventoryRequest): google.cloud.osconfig.v1.GetInventoryRequest; + + /** + * Encodes the specified GetInventoryRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @param message GetInventoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IGetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @param message GetInventoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IGetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.GetInventoryRequest; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.GetInventoryRequest; + + /** + * Verifies a GetInventoryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInventoryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.GetInventoryRequest; + + /** + * Creates a plain object from a GetInventoryRequest message. Also converts values to other types if specified. + * @param message GetInventoryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.GetInventoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInventoryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInventoryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInventoriesRequest. */ + interface IListInventoriesRequest { + + /** ListInventoriesRequest parent */ + parent?: (string|null); + + /** ListInventoriesRequest view */ + view?: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView|null); + + /** ListInventoriesRequest pageSize */ + pageSize?: (number|null); + + /** ListInventoriesRequest pageToken */ + pageToken?: (string|null); + + /** ListInventoriesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListInventoriesRequest. */ + class ListInventoriesRequest implements IListInventoriesRequest { + + /** + * Constructs a new ListInventoriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListInventoriesRequest); + + /** ListInventoriesRequest parent. */ + public parent: string; + + /** ListInventoriesRequest view. */ + public view: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView); + + /** ListInventoriesRequest pageSize. */ + public pageSize: number; + + /** ListInventoriesRequest pageToken. */ + public pageToken: string; + + /** ListInventoriesRequest filter. */ + public filter: string; + + /** + * Creates a new ListInventoriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInventoriesRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListInventoriesRequest): google.cloud.osconfig.v1.ListInventoriesRequest; + + /** + * Encodes the specified ListInventoriesRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @param message ListInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @param message ListInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListInventoriesRequest; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListInventoriesRequest; + + /** + * Verifies a ListInventoriesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInventoriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListInventoriesRequest; + + /** + * Creates a plain object from a ListInventoriesRequest message. Also converts values to other types if specified. + * @param message ListInventoriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInventoriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInventoriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInventoriesResponse. */ + interface IListInventoriesResponse { + + /** ListInventoriesResponse inventories */ + inventories?: (google.cloud.osconfig.v1.IInventory[]|null); + + /** ListInventoriesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInventoriesResponse. */ + class ListInventoriesResponse implements IListInventoriesResponse { + + /** + * Constructs a new ListInventoriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListInventoriesResponse); + + /** ListInventoriesResponse inventories. */ + public inventories: google.cloud.osconfig.v1.IInventory[]; + + /** ListInventoriesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInventoriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInventoriesResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListInventoriesResponse): google.cloud.osconfig.v1.ListInventoriesResponse; + + /** + * Encodes the specified ListInventoriesResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @param message ListInventoriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @param message ListInventoriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListInventoriesResponse; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListInventoriesResponse; + + /** + * Verifies a ListInventoriesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInventoriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListInventoriesResponse; + + /** + * Creates a plain object from a ListInventoriesResponse message. Also converts values to other types if specified. + * @param message ListInventoriesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInventoriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInventoriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** InventoryView enum. */ + enum InventoryView { + INVENTORY_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + + /** Properties of a OSPolicy. */ + interface IOSPolicy { + + /** OSPolicy id */ + id?: (string|null); + + /** OSPolicy description */ + description?: (string|null); + + /** OSPolicy mode */ + mode?: (google.cloud.osconfig.v1.OSPolicy.Mode|keyof typeof google.cloud.osconfig.v1.OSPolicy.Mode|null); + + /** OSPolicy resourceGroups */ + resourceGroups?: (google.cloud.osconfig.v1.OSPolicy.IResourceGroup[]|null); + + /** OSPolicy allowNoResourceGroupMatch */ + allowNoResourceGroupMatch?: (boolean|null); + } + + /** Represents a OSPolicy. */ + class OSPolicy implements IOSPolicy { + + /** + * Constructs a new OSPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IOSPolicy); + + /** OSPolicy id. */ + public id: string; + + /** OSPolicy description. */ + public description: string; + + /** OSPolicy mode. */ + public mode: (google.cloud.osconfig.v1.OSPolicy.Mode|keyof typeof google.cloud.osconfig.v1.OSPolicy.Mode); + + /** OSPolicy resourceGroups. */ + public resourceGroups: google.cloud.osconfig.v1.OSPolicy.IResourceGroup[]; + + /** OSPolicy allowNoResourceGroupMatch. */ + public allowNoResourceGroupMatch: boolean; + + /** + * Creates a new OSPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicy instance + */ + public static create(properties?: google.cloud.osconfig.v1.IOSPolicy): google.cloud.osconfig.v1.OSPolicy; + + /** + * Encodes the specified OSPolicy message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.verify|verify} messages. + * @param message OSPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IOSPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicy message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.verify|verify} messages. + * @param message OSPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IOSPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy; + + /** + * Decodes a OSPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy; + + /** + * Verifies a OSPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy; + + /** + * Creates a plain object from a OSPolicy message. Also converts values to other types if specified. + * @param message OSPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicy { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + VALIDATION = 1, + ENFORCEMENT = 2 + } + + /** Properties of an InventoryFilter. */ + interface IInventoryFilter { + + /** InventoryFilter osShortName */ + osShortName?: (string|null); + + /** InventoryFilter osVersion */ + osVersion?: (string|null); + } + + /** Represents an InventoryFilter. */ + class InventoryFilter implements IInventoryFilter { + + /** + * Constructs a new InventoryFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.IInventoryFilter); + + /** InventoryFilter osShortName. */ + public osShortName: string; + + /** InventoryFilter osVersion. */ + public osVersion: string; + + /** + * Creates a new InventoryFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns InventoryFilter instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.IInventoryFilter): google.cloud.osconfig.v1.OSPolicy.InventoryFilter; + + /** + * Encodes the specified InventoryFilter message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.InventoryFilter.verify|verify} messages. + * @param message InventoryFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.IInventoryFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InventoryFilter message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.InventoryFilter.verify|verify} messages. + * @param message InventoryFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.IInventoryFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InventoryFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InventoryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.InventoryFilter; + + /** + * Decodes an InventoryFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InventoryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.InventoryFilter; + + /** + * Verifies an InventoryFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InventoryFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InventoryFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.InventoryFilter; + + /** + * Creates a plain object from an InventoryFilter message. Also converts values to other types if specified. + * @param message InventoryFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.InventoryFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InventoryFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InventoryFilter + * @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 id */ + id?: (string|null); + + /** Resource pkg */ + pkg?: (google.cloud.osconfig.v1.OSPolicy.Resource.IPackageResource|null); + + /** Resource repository */ + repository?: (google.cloud.osconfig.v1.OSPolicy.Resource.IRepositoryResource|null); + + /** Resource exec */ + exec?: (google.cloud.osconfig.v1.OSPolicy.Resource.IExecResource|null); + + /** Resource file */ + file?: (google.cloud.osconfig.v1.OSPolicy.Resource.IFileResource|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.IResource); + + /** Resource id. */ + public id: string; + + /** Resource pkg. */ + public pkg?: (google.cloud.osconfig.v1.OSPolicy.Resource.IPackageResource|null); + + /** Resource repository. */ + public repository?: (google.cloud.osconfig.v1.OSPolicy.Resource.IRepositoryResource|null); + + /** Resource exec. */ + public exec?: (google.cloud.osconfig.v1.OSPolicy.Resource.IExecResource|null); + + /** Resource file. */ + public file?: (google.cloud.osconfig.v1.OSPolicy.Resource.IFileResource|null); + + /** Resource resourceType. */ + public resourceType?: ("pkg"|"repository"|"exec"|"file"); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.IResource): google.cloud.osconfig.v1.OSPolicy.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.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.osconfig.v1.OSPolicy.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.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.osconfig.v1.OSPolicy.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.osconfig.v1.OSPolicy.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.osconfig.v1.OSPolicy.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.osconfig.v1.OSPolicy.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.osconfig.v1.OSPolicy.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Resource { + + /** Properties of a File. */ + interface IFile { + + /** File remote */ + remote?: (google.cloud.osconfig.v1.OSPolicy.Resource.File.IRemote|null); + + /** File gcs */ + gcs?: (google.cloud.osconfig.v1.OSPolicy.Resource.File.IGcs|null); + + /** File localPath */ + localPath?: (string|null); + + /** File allowInsecure */ + allowInsecure?: (boolean|null); + } + + /** Represents a File. */ + class File implements IFile { + + /** + * Constructs a new File. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.IFile); + + /** File remote. */ + public remote?: (google.cloud.osconfig.v1.OSPolicy.Resource.File.IRemote|null); + + /** File gcs. */ + public gcs?: (google.cloud.osconfig.v1.OSPolicy.Resource.File.IGcs|null); + + /** File localPath. */ + public localPath?: (string|null); + + /** File allowInsecure. */ + public allowInsecure: boolean; + + /** File type. */ + public type?: ("remote"|"gcs"|"localPath"); + + /** + * Creates a new File instance using the specified properties. + * @param [properties] Properties to set + * @returns File instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.IFile): google.cloud.osconfig.v1.OSPolicy.Resource.File; + + /** + * Encodes the specified File message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.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.osconfig.v1.OSPolicy.Resource.IFile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.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.osconfig.v1.OSPolicy.Resource.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.osconfig.v1.OSPolicy.Resource.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.osconfig.v1.OSPolicy.Resource.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.osconfig.v1.OSPolicy.Resource.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.osconfig.v1.OSPolicy.Resource.File, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this File to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for File + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace File { + + /** Properties of a Remote. */ + interface IRemote { + + /** Remote uri */ + uri?: (string|null); + + /** Remote sha256Checksum */ + sha256Checksum?: (string|null); + } + + /** Represents a Remote. */ + class Remote implements IRemote { + + /** + * Constructs a new Remote. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.File.IRemote); + + /** Remote uri. */ + public uri: string; + + /** Remote sha256Checksum. */ + public sha256Checksum: string; + + /** + * Creates a new Remote instance using the specified properties. + * @param [properties] Properties to set + * @returns Remote instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.File.IRemote): google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote; + + /** + * Encodes the specified Remote message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote.verify|verify} messages. + * @param message Remote message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.File.IRemote, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Remote message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote.verify|verify} messages. + * @param message Remote message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.File.IRemote, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Remote message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Remote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote; + + /** + * Decodes a Remote message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Remote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote; + + /** + * Verifies a Remote message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Remote message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Remote + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote; + + /** + * Creates a plain object from a Remote message. Also converts values to other types if specified. + * @param message Remote + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Remote to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Remote + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Gcs. */ + interface IGcs { + + /** Gcs bucket */ + bucket?: (string|null); + + /** Gcs object */ + object?: (string|null); + + /** Gcs generation */ + generation?: (number|Long|string|null); + } + + /** Represents a Gcs. */ + class Gcs implements IGcs { + + /** + * Constructs a new Gcs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.File.IGcs); + + /** Gcs bucket. */ + public bucket: string; + + /** Gcs object. */ + public object: string; + + /** Gcs generation. */ + public generation: (number|Long|string); + + /** + * Creates a new Gcs instance using the specified properties. + * @param [properties] Properties to set + * @returns Gcs instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.File.IGcs): google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs; + + /** + * Encodes the specified Gcs message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs.verify|verify} messages. + * @param message Gcs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.File.IGcs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Gcs message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs.verify|verify} messages. + * @param message Gcs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.File.IGcs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Gcs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Gcs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs; + + /** + * Decodes a Gcs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Gcs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs; + + /** + * Verifies a Gcs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Gcs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Gcs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs; + + /** + * Creates a plain object from a Gcs message. Also converts values to other types if specified. + * @param message Gcs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Gcs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Gcs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PackageResource. */ + interface IPackageResource { + + /** PackageResource desiredState */ + desiredState?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.DesiredState|keyof typeof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.DesiredState|null); + + /** PackageResource apt */ + apt?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IAPT|null); + + /** PackageResource deb */ + deb?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IDeb|null); + + /** PackageResource yum */ + yum?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IYUM|null); + + /** PackageResource zypper */ + zypper?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IZypper|null); + + /** PackageResource rpm */ + rpm?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IRPM|null); + + /** PackageResource googet */ + googet?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IGooGet|null); + + /** PackageResource msi */ + msi?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IMSI|null); + } + + /** Represents a PackageResource. */ + class PackageResource implements IPackageResource { + + /** + * Constructs a new PackageResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.IPackageResource); + + /** PackageResource desiredState. */ + public desiredState: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.DesiredState|keyof typeof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.DesiredState); + + /** PackageResource apt. */ + public apt?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IAPT|null); + + /** PackageResource deb. */ + public deb?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IDeb|null); + + /** PackageResource yum. */ + public yum?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IYUM|null); + + /** PackageResource zypper. */ + public zypper?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IZypper|null); + + /** PackageResource rpm. */ + public rpm?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IRPM|null); + + /** PackageResource googet. */ + public googet?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IGooGet|null); + + /** PackageResource msi. */ + public msi?: (google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IMSI|null); + + /** PackageResource systemPackage. */ + public systemPackage?: ("apt"|"deb"|"yum"|"zypper"|"rpm"|"googet"|"msi"); + + /** + * Creates a new PackageResource instance using the specified properties. + * @param [properties] Properties to set + * @returns PackageResource instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.IPackageResource): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource; + + /** + * Encodes the specified PackageResource message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.verify|verify} messages. + * @param message PackageResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.IPackageResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PackageResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.verify|verify} messages. + * @param message PackageResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.IPackageResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PackageResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PackageResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource; + + /** + * Decodes a PackageResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PackageResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource; + + /** + * Verifies a PackageResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PackageResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PackageResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource; + + /** + * Creates a plain object from a PackageResource message. Also converts values to other types if specified. + * @param message PackageResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PackageResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PackageResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PackageResource { + + /** DesiredState enum. */ + enum DesiredState { + DESIRED_STATE_UNSPECIFIED = 0, + INSTALLED = 1, + REMOVED = 2 + } + + /** Properties of a Deb. */ + interface IDeb { + + /** Deb source */ + source?: (google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null); + + /** Deb pullDeps */ + pullDeps?: (boolean|null); + } + + /** Represents a Deb. */ + class Deb implements IDeb { + + /** + * Constructs a new Deb. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IDeb); + + /** Deb source. */ + public source?: (google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null); + + /** Deb pullDeps. */ + public pullDeps: boolean; + + /** + * Creates a new Deb instance using the specified properties. + * @param [properties] Properties to set + * @returns Deb instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IDeb): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb; + + /** + * Encodes the specified Deb message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb.verify|verify} messages. + * @param message Deb message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IDeb, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deb message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb.verify|verify} messages. + * @param message Deb message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IDeb, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deb message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deb + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb; + + /** + * Decodes a Deb message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deb + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb; + + /** + * Verifies a Deb message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Deb message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deb + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb; + + /** + * Creates a plain object from a Deb message. Also converts values to other types if specified. + * @param message Deb + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deb to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deb + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a APT. */ + interface IAPT { + + /** APT name */ + name?: (string|null); + } + + /** Represents a APT. */ + class APT implements IAPT { + + /** + * Constructs a new APT. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IAPT); + + /** APT name. */ + public name: string; + + /** + * Creates a new APT instance using the specified properties. + * @param [properties] Properties to set + * @returns APT instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IAPT): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT; + + /** + * Encodes the specified APT message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT.verify|verify} messages. + * @param message APT message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IAPT, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified APT message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT.verify|verify} messages. + * @param message APT message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IAPT, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a APT message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns APT + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT; + + /** + * Decodes a APT message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns APT + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT; + + /** + * Verifies a APT message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a APT message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns APT + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT; + + /** + * Creates a plain object from a APT message. Also converts values to other types if specified. + * @param message APT + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this APT to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for APT + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RPM. */ + interface IRPM { + + /** RPM source */ + source?: (google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null); + + /** RPM pullDeps */ + pullDeps?: (boolean|null); + } + + /** Represents a RPM. */ + class RPM implements IRPM { + + /** + * Constructs a new RPM. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IRPM); + + /** RPM source. */ + public source?: (google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null); + + /** RPM pullDeps. */ + public pullDeps: boolean; + + /** + * Creates a new RPM instance using the specified properties. + * @param [properties] Properties to set + * @returns RPM instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IRPM): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM; + + /** + * Encodes the specified RPM message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM.verify|verify} messages. + * @param message RPM message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IRPM, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RPM message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM.verify|verify} messages. + * @param message RPM message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IRPM, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RPM message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RPM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM; + + /** + * Decodes a RPM message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RPM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM; + + /** + * Verifies a RPM message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RPM message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RPM + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM; + + /** + * Creates a plain object from a RPM message. Also converts values to other types if specified. + * @param message RPM + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RPM to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RPM + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a YUM. */ + interface IYUM { + + /** YUM name */ + name?: (string|null); + } + + /** Represents a YUM. */ + class YUM implements IYUM { + + /** + * Constructs a new YUM. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IYUM); + + /** YUM name. */ + public name: string; + + /** + * Creates a new YUM instance using the specified properties. + * @param [properties] Properties to set + * @returns YUM instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IYUM): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM; + + /** + * Encodes the specified YUM message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM.verify|verify} messages. + * @param message YUM message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IYUM, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified YUM message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM.verify|verify} messages. + * @param message YUM message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IYUM, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a YUM message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns YUM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM; + + /** + * Decodes a YUM message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns YUM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM; + + /** + * Verifies a YUM message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a YUM message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns YUM + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM; + + /** + * Creates a plain object from a YUM message. Also converts values to other types if specified. + * @param message YUM + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this YUM to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for YUM + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Zypper. */ + interface IZypper { + + /** Zypper name */ + name?: (string|null); + } + + /** Represents a Zypper. */ + class Zypper implements IZypper { + + /** + * Constructs a new Zypper. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IZypper); + + /** Zypper name. */ + public name: string; + + /** + * Creates a new Zypper instance using the specified properties. + * @param [properties] Properties to set + * @returns Zypper instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IZypper): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper; + + /** + * Encodes the specified Zypper message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper.verify|verify} messages. + * @param message Zypper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IZypper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Zypper message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper.verify|verify} messages. + * @param message Zypper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IZypper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Zypper message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Zypper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper; + + /** + * Decodes a Zypper message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Zypper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper; + + /** + * Verifies a Zypper message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Zypper message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Zypper + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper; + + /** + * Creates a plain object from a Zypper message. Also converts values to other types if specified. + * @param message Zypper + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Zypper to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Zypper + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GooGet. */ + interface IGooGet { + + /** GooGet name */ + name?: (string|null); + } + + /** Represents a GooGet. */ + class GooGet implements IGooGet { + + /** + * Constructs a new GooGet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IGooGet); + + /** GooGet name. */ + public name: string; + + /** + * Creates a new GooGet instance using the specified properties. + * @param [properties] Properties to set + * @returns GooGet instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IGooGet): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet; + + /** + * Encodes the specified GooGet message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet.verify|verify} messages. + * @param message GooGet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IGooGet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GooGet message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet.verify|verify} messages. + * @param message GooGet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IGooGet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GooGet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GooGet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet; + + /** + * Decodes a GooGet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GooGet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet; + + /** + * Verifies a GooGet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GooGet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GooGet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet; + + /** + * Creates a plain object from a GooGet message. Also converts values to other types if specified. + * @param message GooGet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GooGet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GooGet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MSI. */ + interface IMSI { + + /** MSI source */ + source?: (google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null); + + /** MSI properties */ + properties?: (string[]|null); + } + + /** Represents a MSI. */ + class MSI implements IMSI { + + /** + * Constructs a new MSI. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IMSI); + + /** MSI source. */ + public source?: (google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null); + + /** MSI properties. */ + public properties: string[]; + + /** + * Creates a new MSI instance using the specified properties. + * @param [properties] Properties to set + * @returns MSI instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IMSI): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI; + + /** + * Encodes the specified MSI message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI.verify|verify} messages. + * @param message MSI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IMSI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MSI message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI.verify|verify} messages. + * @param message MSI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IMSI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MSI message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MSI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI; + + /** + * Decodes a MSI message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MSI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI; + + /** + * Verifies a MSI message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MSI message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MSI + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI; + + /** + * Creates a plain object from a MSI message. Also converts values to other types if specified. + * @param message MSI + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MSI to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MSI + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RepositoryResource. */ + interface IRepositoryResource { + + /** RepositoryResource apt */ + apt?: (google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IAptRepository|null); + + /** RepositoryResource yum */ + yum?: (google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IYumRepository|null); + + /** RepositoryResource zypper */ + zypper?: (google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IZypperRepository|null); + + /** RepositoryResource goo */ + goo?: (google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IGooRepository|null); + } + + /** Represents a RepositoryResource. */ + class RepositoryResource implements IRepositoryResource { + + /** + * Constructs a new RepositoryResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.IRepositoryResource); + + /** RepositoryResource apt. */ + public apt?: (google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IAptRepository|null); + + /** RepositoryResource yum. */ + public yum?: (google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IYumRepository|null); + + /** RepositoryResource zypper. */ + public zypper?: (google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IZypperRepository|null); + + /** RepositoryResource goo. */ + public goo?: (google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IGooRepository|null); + + /** RepositoryResource repository. */ + public repository?: ("apt"|"yum"|"zypper"|"goo"); + + /** + * Creates a new RepositoryResource instance using the specified properties. + * @param [properties] Properties to set + * @returns RepositoryResource instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.IRepositoryResource): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource; + + /** + * Encodes the specified RepositoryResource message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.verify|verify} messages. + * @param message RepositoryResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.IRepositoryResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RepositoryResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.verify|verify} messages. + * @param message RepositoryResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.IRepositoryResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RepositoryResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RepositoryResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource; + + /** + * Decodes a RepositoryResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RepositoryResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource; + + /** + * Verifies a RepositoryResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RepositoryResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RepositoryResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource; + + /** + * Creates a plain object from a RepositoryResource message. Also converts values to other types if specified. + * @param message RepositoryResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RepositoryResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RepositoryResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RepositoryResource { + + /** Properties of an AptRepository. */ + interface IAptRepository { + + /** AptRepository archiveType */ + archiveType?: (google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType|keyof typeof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType|null); + + /** AptRepository uri */ + uri?: (string|null); + + /** AptRepository distribution */ + distribution?: (string|null); + + /** AptRepository components */ + components?: (string[]|null); + + /** AptRepository gpgKey */ + gpgKey?: (string|null); + } + + /** Represents an AptRepository. */ + class AptRepository implements IAptRepository { + + /** + * Constructs a new AptRepository. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IAptRepository); + + /** AptRepository archiveType. */ + public archiveType: (google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType|keyof typeof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType); + + /** AptRepository uri. */ + public uri: string; + + /** AptRepository distribution. */ + public distribution: string; + + /** AptRepository components. */ + public components: string[]; + + /** AptRepository gpgKey. */ + public gpgKey: string; + + /** + * Creates a new AptRepository instance using the specified properties. + * @param [properties] Properties to set + * @returns AptRepository instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IAptRepository): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository; + + /** + * Encodes the specified AptRepository message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.verify|verify} messages. + * @param message AptRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IAptRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AptRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.verify|verify} messages. + * @param message AptRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IAptRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AptRepository message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AptRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository; + + /** + * Decodes an AptRepository message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AptRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository; + + /** + * Verifies an AptRepository message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AptRepository message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AptRepository + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository; + + /** + * Creates a plain object from an AptRepository message. Also converts values to other types if specified. + * @param message AptRepository + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AptRepository to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AptRepository + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AptRepository { + + /** ArchiveType enum. */ + enum ArchiveType { + ARCHIVE_TYPE_UNSPECIFIED = 0, + DEB = 1, + DEB_SRC = 2 + } + } + + /** Properties of a YumRepository. */ + interface IYumRepository { + + /** YumRepository id */ + id?: (string|null); + + /** YumRepository displayName */ + displayName?: (string|null); + + /** YumRepository baseUrl */ + baseUrl?: (string|null); + + /** YumRepository gpgKeys */ + gpgKeys?: (string[]|null); + } + + /** Represents a YumRepository. */ + class YumRepository implements IYumRepository { + + /** + * Constructs a new YumRepository. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IYumRepository); + + /** YumRepository id. */ + public id: string; + + /** YumRepository displayName. */ + public displayName: string; + + /** YumRepository baseUrl. */ + public baseUrl: string; + + /** YumRepository gpgKeys. */ + public gpgKeys: string[]; + + /** + * Creates a new YumRepository instance using the specified properties. + * @param [properties] Properties to set + * @returns YumRepository instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IYumRepository): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository; + + /** + * Encodes the specified YumRepository message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository.verify|verify} messages. + * @param message YumRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IYumRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified YumRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository.verify|verify} messages. + * @param message YumRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IYumRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a YumRepository message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns YumRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository; + + /** + * Decodes a YumRepository message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns YumRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository; + + /** + * Verifies a YumRepository message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a YumRepository message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns YumRepository + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository; + + /** + * Creates a plain object from a YumRepository message. Also converts values to other types if specified. + * @param message YumRepository + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this YumRepository to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for YumRepository + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ZypperRepository. */ + interface IZypperRepository { + + /** ZypperRepository id */ + id?: (string|null); + + /** ZypperRepository displayName */ + displayName?: (string|null); + + /** ZypperRepository baseUrl */ + baseUrl?: (string|null); + + /** ZypperRepository gpgKeys */ + gpgKeys?: (string[]|null); + } + + /** Represents a ZypperRepository. */ + class ZypperRepository implements IZypperRepository { + + /** + * Constructs a new ZypperRepository. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IZypperRepository); + + /** ZypperRepository id. */ + public id: string; + + /** ZypperRepository displayName. */ + public displayName: string; + + /** ZypperRepository baseUrl. */ + public baseUrl: string; + + /** ZypperRepository gpgKeys. */ + public gpgKeys: string[]; + + /** + * Creates a new ZypperRepository instance using the specified properties. + * @param [properties] Properties to set + * @returns ZypperRepository instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IZypperRepository): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository; + + /** + * Encodes the specified ZypperRepository message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository.verify|verify} messages. + * @param message ZypperRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IZypperRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZypperRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository.verify|verify} messages. + * @param message ZypperRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IZypperRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZypperRepository message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZypperRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository; + + /** + * Decodes a ZypperRepository message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZypperRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository; + + /** + * Verifies a ZypperRepository message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ZypperRepository message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZypperRepository + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository; + + /** + * Creates a plain object from a ZypperRepository message. Also converts values to other types if specified. + * @param message ZypperRepository + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZypperRepository to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ZypperRepository + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GooRepository. */ + interface IGooRepository { + + /** GooRepository name */ + name?: (string|null); + + /** GooRepository url */ + url?: (string|null); + } + + /** Represents a GooRepository. */ + class GooRepository implements IGooRepository { + + /** + * Constructs a new GooRepository. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IGooRepository); + + /** GooRepository name. */ + public name: string; + + /** GooRepository url. */ + public url: string; + + /** + * Creates a new GooRepository instance using the specified properties. + * @param [properties] Properties to set + * @returns GooRepository instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IGooRepository): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository; + + /** + * Encodes the specified GooRepository message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository.verify|verify} messages. + * @param message GooRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IGooRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GooRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository.verify|verify} messages. + * @param message GooRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IGooRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GooRepository message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GooRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository; + + /** + * Decodes a GooRepository message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GooRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository; + + /** + * Verifies a GooRepository message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GooRepository message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GooRepository + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository; + + /** + * Creates a plain object from a GooRepository message. Also converts values to other types if specified. + * @param message GooRepository + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GooRepository to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GooRepository + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExecResource. */ + interface IExecResource { + + /** ExecResource validate */ + validate?: (google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec|null); + + /** ExecResource enforce */ + enforce?: (google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec|null); + } + + /** Represents an ExecResource. */ + class ExecResource implements IExecResource { + + /** + * Constructs a new ExecResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.IExecResource); + + /** ExecResource validate. */ + public validate?: (google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec|null); + + /** ExecResource enforce. */ + public enforce?: (google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec|null); + + /** + * Creates a new ExecResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecResource instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.IExecResource): google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource; + + /** + * Encodes the specified ExecResource message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.verify|verify} messages. + * @param message ExecResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.IExecResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.verify|verify} messages. + * @param message ExecResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.IExecResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource; + + /** + * Decodes an ExecResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource; + + /** + * Verifies an ExecResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource; + + /** + * Creates a plain object from an ExecResource message. Also converts values to other types if specified. + * @param message ExecResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecResource { + + /** Properties of an Exec. */ + interface IExec { + + /** Exec file */ + file?: (google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null); + + /** Exec script */ + script?: (string|null); + + /** Exec args */ + args?: (string[]|null); + + /** Exec interpreter */ + interpreter?: (google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.Interpreter|keyof typeof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.Interpreter|null); + + /** Exec outputFilePath */ + outputFilePath?: (string|null); + } + + /** Represents an Exec. */ + class Exec implements IExec { + + /** + * Constructs a new Exec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec); + + /** Exec file. */ + public file?: (google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null); + + /** Exec script. */ + public script?: (string|null); + + /** Exec args. */ + public args: string[]; + + /** Exec interpreter. */ + public interpreter: (google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.Interpreter|keyof typeof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.Interpreter); + + /** Exec outputFilePath. */ + public outputFilePath: string; + + /** Exec source. */ + public source?: ("file"|"script"); + + /** + * Creates a new Exec instance using the specified properties. + * @param [properties] Properties to set + * @returns Exec instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec): google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec; + + /** + * Encodes the specified Exec message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.verify|verify} messages. + * @param message Exec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Exec message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.verify|verify} messages. + * @param message Exec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Exec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Exec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec; + + /** + * Decodes an Exec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Exec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec; + + /** + * Verifies an Exec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Exec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Exec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec; + + /** + * Creates a plain object from an Exec message. Also converts values to other types if specified. + * @param message Exec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Exec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Exec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Exec { + + /** Interpreter enum. */ + enum Interpreter { + INTERPRETER_UNSPECIFIED = 0, + NONE = 1, + SHELL = 2, + POWERSHELL = 3 + } + } + } + + /** Properties of a FileResource. */ + interface IFileResource { + + /** FileResource file */ + file?: (google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null); + + /** FileResource content */ + content?: (string|null); + + /** FileResource path */ + path?: (string|null); + + /** FileResource state */ + state?: (google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.DesiredState|keyof typeof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.DesiredState|null); + + /** FileResource permissions */ + permissions?: (string|null); + } + + /** Represents a FileResource. */ + class FileResource implements IFileResource { + + /** + * Constructs a new FileResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.IFileResource); + + /** FileResource file. */ + public file?: (google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null); + + /** FileResource content. */ + public content?: (string|null); + + /** FileResource path. */ + public path: string; + + /** FileResource state. */ + public state: (google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.DesiredState|keyof typeof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.DesiredState); + + /** FileResource permissions. */ + public permissions: string; + + /** FileResource source. */ + public source?: ("file"|"content"); + + /** + * Creates a new FileResource instance using the specified properties. + * @param [properties] Properties to set + * @returns FileResource instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.Resource.IFileResource): google.cloud.osconfig.v1.OSPolicy.Resource.FileResource; + + /** + * Encodes the specified FileResource message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.verify|verify} messages. + * @param message FileResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.Resource.IFileResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.verify|verify} messages. + * @param message FileResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.Resource.IFileResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.Resource.FileResource; + + /** + * Decodes a FileResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.Resource.FileResource; + + /** + * Verifies a FileResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.Resource.FileResource; + + /** + * Creates a plain object from a FileResource message. Also converts values to other types if specified. + * @param message FileResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.Resource.FileResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileResource { + + /** DesiredState enum. */ + enum DesiredState { + DESIRED_STATE_UNSPECIFIED = 0, + PRESENT = 1, + ABSENT = 2, + CONTENTS_MATCH = 3 + } + } + } + + /** Properties of a ResourceGroup. */ + interface IResourceGroup { + + /** ResourceGroup inventoryFilters */ + inventoryFilters?: (google.cloud.osconfig.v1.OSPolicy.IInventoryFilter[]|null); + + /** ResourceGroup resources */ + resources?: (google.cloud.osconfig.v1.OSPolicy.IResource[]|null); + } + + /** Represents a ResourceGroup. */ + class ResourceGroup implements IResourceGroup { + + /** + * Constructs a new ResourceGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicy.IResourceGroup); + + /** ResourceGroup inventoryFilters. */ + public inventoryFilters: google.cloud.osconfig.v1.OSPolicy.IInventoryFilter[]; + + /** ResourceGroup resources. */ + public resources: google.cloud.osconfig.v1.OSPolicy.IResource[]; + + /** + * Creates a new ResourceGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceGroup instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicy.IResourceGroup): google.cloud.osconfig.v1.OSPolicy.ResourceGroup; + + /** + * Encodes the specified ResourceGroup message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.ResourceGroup.verify|verify} messages. + * @param message ResourceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicy.IResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceGroup message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.ResourceGroup.verify|verify} messages. + * @param message ResourceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicy.IResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicy.ResourceGroup; + + /** + * Decodes a ResourceGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicy.ResourceGroup; + + /** + * Verifies a ResourceGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicy.ResourceGroup; + + /** + * Creates a plain object from a ResourceGroup message. Also converts values to other types if specified. + * @param message ResourceGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicy.ResourceGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GetOSPolicyAssignmentReportRequest. */ + interface IGetOSPolicyAssignmentReportRequest { + + /** GetOSPolicyAssignmentReportRequest name */ + name?: (string|null); + } + + /** Represents a GetOSPolicyAssignmentReportRequest. */ + class GetOSPolicyAssignmentReportRequest implements IGetOSPolicyAssignmentReportRequest { + + /** + * Constructs a new GetOSPolicyAssignmentReportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest); + + /** GetOSPolicyAssignmentReportRequest name. */ + public name: string; + + /** + * Creates a new GetOSPolicyAssignmentReportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOSPolicyAssignmentReportRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest): google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest; + + /** + * Encodes the specified GetOSPolicyAssignmentReportRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest.verify|verify} messages. + * @param message GetOSPolicyAssignmentReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOSPolicyAssignmentReportRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest.verify|verify} messages. + * @param message GetOSPolicyAssignmentReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOSPolicyAssignmentReportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOSPolicyAssignmentReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest; + + /** + * Decodes a GetOSPolicyAssignmentReportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOSPolicyAssignmentReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest; + + /** + * Verifies a GetOSPolicyAssignmentReportRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOSPolicyAssignmentReportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOSPolicyAssignmentReportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest; + + /** + * Creates a plain object from a GetOSPolicyAssignmentReportRequest message. Also converts values to other types if specified. + * @param message GetOSPolicyAssignmentReportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOSPolicyAssignmentReportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOSPolicyAssignmentReportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOSPolicyAssignmentReportsRequest. */ + interface IListOSPolicyAssignmentReportsRequest { + + /** ListOSPolicyAssignmentReportsRequest parent */ + parent?: (string|null); + + /** ListOSPolicyAssignmentReportsRequest pageSize */ + pageSize?: (number|null); + + /** ListOSPolicyAssignmentReportsRequest filter */ + filter?: (string|null); + + /** ListOSPolicyAssignmentReportsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOSPolicyAssignmentReportsRequest. */ + class ListOSPolicyAssignmentReportsRequest implements IListOSPolicyAssignmentReportsRequest { + + /** + * Constructs a new ListOSPolicyAssignmentReportsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest); + + /** ListOSPolicyAssignmentReportsRequest parent. */ + public parent: string; + + /** ListOSPolicyAssignmentReportsRequest pageSize. */ + public pageSize: number; + + /** ListOSPolicyAssignmentReportsRequest filter. */ + public filter: string; + + /** ListOSPolicyAssignmentReportsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOSPolicyAssignmentReportsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOSPolicyAssignmentReportsRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest): google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest.verify|verify} messages. + * @param message ListOSPolicyAssignmentReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest.verify|verify} messages. + * @param message ListOSPolicyAssignmentReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOSPolicyAssignmentReportsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOSPolicyAssignmentReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest; + + /** + * Decodes a ListOSPolicyAssignmentReportsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOSPolicyAssignmentReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest; + + /** + * Verifies a ListOSPolicyAssignmentReportsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOSPolicyAssignmentReportsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOSPolicyAssignmentReportsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest; + + /** + * Creates a plain object from a ListOSPolicyAssignmentReportsRequest message. Also converts values to other types if specified. + * @param message ListOSPolicyAssignmentReportsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOSPolicyAssignmentReportsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOSPolicyAssignmentReportsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOSPolicyAssignmentReportsResponse. */ + interface IListOSPolicyAssignmentReportsResponse { + + /** ListOSPolicyAssignmentReportsResponse osPolicyAssignmentReports */ + osPolicyAssignmentReports?: (google.cloud.osconfig.v1.IOSPolicyAssignmentReport[]|null); + + /** ListOSPolicyAssignmentReportsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOSPolicyAssignmentReportsResponse. */ + class ListOSPolicyAssignmentReportsResponse implements IListOSPolicyAssignmentReportsResponse { + + /** + * Constructs a new ListOSPolicyAssignmentReportsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse); + + /** ListOSPolicyAssignmentReportsResponse osPolicyAssignmentReports. */ + public osPolicyAssignmentReports: google.cloud.osconfig.v1.IOSPolicyAssignmentReport[]; + + /** ListOSPolicyAssignmentReportsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOSPolicyAssignmentReportsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOSPolicyAssignmentReportsResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse): google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse.verify|verify} messages. + * @param message ListOSPolicyAssignmentReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse.verify|verify} messages. + * @param message ListOSPolicyAssignmentReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOSPolicyAssignmentReportsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOSPolicyAssignmentReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse; + + /** + * Decodes a ListOSPolicyAssignmentReportsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOSPolicyAssignmentReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse; + + /** + * Verifies a ListOSPolicyAssignmentReportsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOSPolicyAssignmentReportsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOSPolicyAssignmentReportsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse; + + /** + * Creates a plain object from a ListOSPolicyAssignmentReportsResponse message. Also converts values to other types if specified. + * @param message ListOSPolicyAssignmentReportsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOSPolicyAssignmentReportsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOSPolicyAssignmentReportsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a OSPolicyAssignmentReport. */ + interface IOSPolicyAssignmentReport { + + /** OSPolicyAssignmentReport name */ + name?: (string|null); + + /** OSPolicyAssignmentReport instance */ + instance?: (string|null); + + /** OSPolicyAssignmentReport osPolicyAssignment */ + osPolicyAssignment?: (string|null); + + /** OSPolicyAssignmentReport osPolicyCompliances */ + osPolicyCompliances?: (google.cloud.osconfig.v1.OSPolicyAssignmentReport.IOSPolicyCompliance[]|null); + + /** OSPolicyAssignmentReport updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** OSPolicyAssignmentReport lastRunId */ + lastRunId?: (string|null); + } + + /** Represents a OSPolicyAssignmentReport. */ + class OSPolicyAssignmentReport implements IOSPolicyAssignmentReport { + + /** + * Constructs a new OSPolicyAssignmentReport. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IOSPolicyAssignmentReport); + + /** OSPolicyAssignmentReport name. */ + public name: string; + + /** OSPolicyAssignmentReport instance. */ + public instance: string; + + /** OSPolicyAssignmentReport osPolicyAssignment. */ + public osPolicyAssignment: string; + + /** OSPolicyAssignmentReport osPolicyCompliances. */ + public osPolicyCompliances: google.cloud.osconfig.v1.OSPolicyAssignmentReport.IOSPolicyCompliance[]; + + /** OSPolicyAssignmentReport updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** OSPolicyAssignmentReport lastRunId. */ + public lastRunId: string; + + /** + * Creates a new OSPolicyAssignmentReport instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyAssignmentReport instance + */ + public static create(properties?: google.cloud.osconfig.v1.IOSPolicyAssignmentReport): google.cloud.osconfig.v1.OSPolicyAssignmentReport; + + /** + * Encodes the specified OSPolicyAssignmentReport message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.verify|verify} messages. + * @param message OSPolicyAssignmentReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IOSPolicyAssignmentReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyAssignmentReport message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.verify|verify} messages. + * @param message OSPolicyAssignmentReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IOSPolicyAssignmentReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyAssignmentReport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyAssignmentReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicyAssignmentReport; + + /** + * Decodes a OSPolicyAssignmentReport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyAssignmentReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicyAssignmentReport; + + /** + * Verifies a OSPolicyAssignmentReport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyAssignmentReport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyAssignmentReport + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicyAssignmentReport; + + /** + * Creates a plain object from a OSPolicyAssignmentReport message. Also converts values to other types if specified. + * @param message OSPolicyAssignmentReport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicyAssignmentReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyAssignmentReport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyAssignmentReport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyAssignmentReport { + + /** Properties of a OSPolicyCompliance. */ + interface IOSPolicyCompliance { + + /** OSPolicyCompliance osPolicyId */ + osPolicyId?: (string|null); + + /** OSPolicyCompliance complianceState */ + complianceState?: (google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState|keyof typeof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState|null); + + /** OSPolicyCompliance complianceStateReason */ + complianceStateReason?: (string|null); + + /** OSPolicyCompliance osPolicyResourceCompliances */ + osPolicyResourceCompliances?: (google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance[]|null); + } + + /** Represents a OSPolicyCompliance. */ + class OSPolicyCompliance implements IOSPolicyCompliance { + + /** + * Constructs a new OSPolicyCompliance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicyAssignmentReport.IOSPolicyCompliance); + + /** OSPolicyCompliance osPolicyId. */ + public osPolicyId: string; + + /** OSPolicyCompliance complianceState. */ + public complianceState: (google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState|keyof typeof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState); + + /** OSPolicyCompliance complianceStateReason. */ + public complianceStateReason: string; + + /** OSPolicyCompliance osPolicyResourceCompliances. */ + public osPolicyResourceCompliances: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance[]; + + /** + * Creates a new OSPolicyCompliance instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyCompliance instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicyAssignmentReport.IOSPolicyCompliance): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance; + + /** + * Encodes the specified OSPolicyCompliance message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.verify|verify} messages. + * @param message OSPolicyCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicyAssignmentReport.IOSPolicyCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.verify|verify} messages. + * @param message OSPolicyCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicyAssignmentReport.IOSPolicyCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyCompliance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance; + + /** + * Decodes a OSPolicyCompliance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance; + + /** + * Verifies a OSPolicyCompliance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyCompliance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyCompliance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance; + + /** + * Creates a plain object from a OSPolicyCompliance message. Also converts values to other types if specified. + * @param message OSPolicyCompliance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyCompliance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyCompliance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyCompliance { + + /** ComplianceState enum. */ + enum ComplianceState { + UNKNOWN = 0, + COMPLIANT = 1, + NON_COMPLIANT = 2 + } + + /** Properties of a OSPolicyResourceCompliance. */ + interface IOSPolicyResourceCompliance { + + /** OSPolicyResourceCompliance osPolicyResourceId */ + osPolicyResourceId?: (string|null); + + /** OSPolicyResourceCompliance configSteps */ + configSteps?: (google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep[]|null); + + /** OSPolicyResourceCompliance complianceState */ + complianceState?: (google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState|keyof typeof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState|null); + + /** OSPolicyResourceCompliance complianceStateReason */ + complianceStateReason?: (string|null); + + /** OSPolicyResourceCompliance execResourceOutput */ + execResourceOutput?: (google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput|null); + } + + /** Represents a OSPolicyResourceCompliance. */ + class OSPolicyResourceCompliance implements IOSPolicyResourceCompliance { + + /** + * Constructs a new OSPolicyResourceCompliance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance); + + /** OSPolicyResourceCompliance osPolicyResourceId. */ + public osPolicyResourceId: string; + + /** OSPolicyResourceCompliance configSteps. */ + public configSteps: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep[]; + + /** OSPolicyResourceCompliance complianceState. */ + public complianceState: (google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState|keyof typeof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState); + + /** OSPolicyResourceCompliance complianceStateReason. */ + public complianceStateReason: string; + + /** OSPolicyResourceCompliance execResourceOutput. */ + public execResourceOutput?: (google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput|null); + + /** OSPolicyResourceCompliance output. */ + public output?: "execResourceOutput"; + + /** + * Creates a new OSPolicyResourceCompliance instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyResourceCompliance instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance; + + /** + * Encodes the specified OSPolicyResourceCompliance message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.verify|verify} messages. + * @param message OSPolicyResourceCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyResourceCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.verify|verify} messages. + * @param message OSPolicyResourceCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyResourceCompliance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyResourceCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance; + + /** + * Decodes a OSPolicyResourceCompliance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyResourceCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance; + + /** + * Verifies a OSPolicyResourceCompliance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyResourceCompliance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyResourceCompliance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance; + + /** + * Creates a plain object from a OSPolicyResourceCompliance message. Also converts values to other types if specified. + * @param message OSPolicyResourceCompliance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyResourceCompliance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyResourceCompliance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyResourceCompliance { + + /** Properties of a OSPolicyResourceConfigStep. */ + interface IOSPolicyResourceConfigStep { + + /** OSPolicyResourceConfigStep type */ + type?: (google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type|keyof typeof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type|null); + + /** OSPolicyResourceConfigStep errorMessage */ + errorMessage?: (string|null); + } + + /** Represents a OSPolicyResourceConfigStep. */ + class OSPolicyResourceConfigStep implements IOSPolicyResourceConfigStep { + + /** + * Constructs a new OSPolicyResourceConfigStep. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep); + + /** OSPolicyResourceConfigStep type. */ + public type: (google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type|keyof typeof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type); + + /** OSPolicyResourceConfigStep errorMessage. */ + public errorMessage: string; + + /** + * Creates a new OSPolicyResourceConfigStep instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyResourceConfigStep instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep; + + /** + * Encodes the specified OSPolicyResourceConfigStep message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.verify|verify} messages. + * @param message OSPolicyResourceConfigStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyResourceConfigStep message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.verify|verify} messages. + * @param message OSPolicyResourceConfigStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyResourceConfigStep message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyResourceConfigStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep; + + /** + * Decodes a OSPolicyResourceConfigStep message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyResourceConfigStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep; + + /** + * Verifies a OSPolicyResourceConfigStep message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyResourceConfigStep message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyResourceConfigStep + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep; + + /** + * Creates a plain object from a OSPolicyResourceConfigStep message. Also converts values to other types if specified. + * @param message OSPolicyResourceConfigStep + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyResourceConfigStep to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyResourceConfigStep + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyResourceConfigStep { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + VALIDATION = 1, + DESIRED_STATE_CHECK = 2, + DESIRED_STATE_ENFORCEMENT = 3, + DESIRED_STATE_CHECK_POST_ENFORCEMENT = 4 + } + } + + /** ComplianceState enum. */ + enum ComplianceState { + UNKNOWN = 0, + COMPLIANT = 1, + NON_COMPLIANT = 2 + } + + /** Properties of an ExecResourceOutput. */ + interface IExecResourceOutput { + + /** ExecResourceOutput enforcementOutput */ + enforcementOutput?: (Uint8Array|string|null); + } + + /** Represents an ExecResourceOutput. */ + class ExecResourceOutput implements IExecResourceOutput { + + /** + * Constructs a new ExecResourceOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput); + + /** ExecResourceOutput enforcementOutput. */ + public enforcementOutput: (Uint8Array|string); + + /** + * Creates a new ExecResourceOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecResourceOutput instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput; + + /** + * Encodes the specified ExecResourceOutput message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.verify|verify} messages. + * @param message ExecResourceOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecResourceOutput message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.verify|verify} messages. + * @param message ExecResourceOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecResourceOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecResourceOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput; + + /** + * Decodes an ExecResourceOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecResourceOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput; + + /** + * Verifies an ExecResourceOutput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecResourceOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecResourceOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput; + + /** + * Creates a plain object from an ExecResourceOutput message. Also converts values to other types if specified. + * @param message ExecResourceOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecResourceOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecResourceOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Properties of a OSPolicyAssignment. */ + interface IOSPolicyAssignment { + + /** OSPolicyAssignment name */ + name?: (string|null); + + /** OSPolicyAssignment description */ + description?: (string|null); + + /** OSPolicyAssignment osPolicies */ + osPolicies?: (google.cloud.osconfig.v1.IOSPolicy[]|null); + + /** OSPolicyAssignment instanceFilter */ + instanceFilter?: (google.cloud.osconfig.v1.OSPolicyAssignment.IInstanceFilter|null); + + /** OSPolicyAssignment rollout */ + rollout?: (google.cloud.osconfig.v1.OSPolicyAssignment.IRollout|null); + + /** OSPolicyAssignment revisionId */ + revisionId?: (string|null); + + /** OSPolicyAssignment revisionCreateTime */ + revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** OSPolicyAssignment etag */ + etag?: (string|null); + + /** OSPolicyAssignment rolloutState */ + rolloutState?: (google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState|keyof typeof google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState|null); + + /** OSPolicyAssignment baseline */ + baseline?: (boolean|null); + + /** OSPolicyAssignment deleted */ + deleted?: (boolean|null); + + /** OSPolicyAssignment reconciling */ + reconciling?: (boolean|null); + + /** OSPolicyAssignment uid */ + uid?: (string|null); + } + + /** Represents a OSPolicyAssignment. */ + class OSPolicyAssignment implements IOSPolicyAssignment { + + /** + * Constructs a new OSPolicyAssignment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IOSPolicyAssignment); + + /** OSPolicyAssignment name. */ + public name: string; + + /** OSPolicyAssignment description. */ + public description: string; + + /** OSPolicyAssignment osPolicies. */ + public osPolicies: google.cloud.osconfig.v1.IOSPolicy[]; + + /** OSPolicyAssignment instanceFilter. */ + public instanceFilter?: (google.cloud.osconfig.v1.OSPolicyAssignment.IInstanceFilter|null); + + /** OSPolicyAssignment rollout. */ + public rollout?: (google.cloud.osconfig.v1.OSPolicyAssignment.IRollout|null); + + /** OSPolicyAssignment revisionId. */ + public revisionId: string; + + /** OSPolicyAssignment revisionCreateTime. */ + public revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** OSPolicyAssignment etag. */ + public etag: string; + + /** OSPolicyAssignment rolloutState. */ + public rolloutState: (google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState|keyof typeof google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState); + + /** OSPolicyAssignment baseline. */ + public baseline: boolean; + + /** OSPolicyAssignment deleted. */ + public deleted: boolean; + + /** OSPolicyAssignment reconciling. */ + public reconciling: boolean; + + /** OSPolicyAssignment uid. */ + public uid: string; + + /** + * Creates a new OSPolicyAssignment instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyAssignment instance + */ + public static create(properties?: google.cloud.osconfig.v1.IOSPolicyAssignment): google.cloud.osconfig.v1.OSPolicyAssignment; + + /** + * Encodes the specified OSPolicyAssignment message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.verify|verify} messages. + * @param message OSPolicyAssignment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IOSPolicyAssignment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyAssignment message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.verify|verify} messages. + * @param message OSPolicyAssignment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IOSPolicyAssignment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyAssignment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicyAssignment; + + /** + * Decodes a OSPolicyAssignment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicyAssignment; + + /** + * Verifies a OSPolicyAssignment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyAssignment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyAssignment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicyAssignment; + + /** + * Creates a plain object from a OSPolicyAssignment message. Also converts values to other types if specified. + * @param message OSPolicyAssignment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicyAssignment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyAssignment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyAssignment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyAssignment { + + /** Properties of a LabelSet. */ + interface ILabelSet { + + /** LabelSet labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a LabelSet. */ + class LabelSet implements ILabelSet { + + /** + * Constructs a new LabelSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicyAssignment.ILabelSet); + + /** LabelSet labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new LabelSet instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelSet instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicyAssignment.ILabelSet): google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet; + + /** + * Encodes the specified LabelSet message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.verify|verify} messages. + * @param message LabelSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicyAssignment.ILabelSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelSet message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.verify|verify} messages. + * @param message LabelSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicyAssignment.ILabelSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet; + + /** + * Decodes a LabelSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet; + + /** + * Verifies a LabelSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet; + + /** + * Creates a plain object from a LabelSet message. Also converts values to other types if specified. + * @param message LabelSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceFilter. */ + interface IInstanceFilter { + + /** InstanceFilter all */ + all?: (boolean|null); + + /** InstanceFilter inclusionLabels */ + inclusionLabels?: (google.cloud.osconfig.v1.OSPolicyAssignment.ILabelSet[]|null); + + /** InstanceFilter exclusionLabels */ + exclusionLabels?: (google.cloud.osconfig.v1.OSPolicyAssignment.ILabelSet[]|null); + + /** InstanceFilter inventories */ + inventories?: (google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.IInventory[]|null); + } + + /** Represents an InstanceFilter. */ + class InstanceFilter implements IInstanceFilter { + + /** + * Constructs a new InstanceFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicyAssignment.IInstanceFilter); + + /** InstanceFilter all. */ + public all: boolean; + + /** InstanceFilter inclusionLabels. */ + public inclusionLabels: google.cloud.osconfig.v1.OSPolicyAssignment.ILabelSet[]; + + /** InstanceFilter exclusionLabels. */ + public exclusionLabels: google.cloud.osconfig.v1.OSPolicyAssignment.ILabelSet[]; + + /** InstanceFilter inventories. */ + public inventories: google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.IInventory[]; + + /** + * Creates a new InstanceFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceFilter instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicyAssignment.IInstanceFilter): google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter; + + /** + * Encodes the specified InstanceFilter message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.verify|verify} messages. + * @param message InstanceFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicyAssignment.IInstanceFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceFilter message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.verify|verify} messages. + * @param message InstanceFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicyAssignment.IInstanceFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter; + + /** + * Decodes an InstanceFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter; + + /** + * Verifies an InstanceFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter; + + /** + * Creates a plain object from an InstanceFilter message. Also converts values to other types if specified. + * @param message InstanceFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstanceFilter { + + /** Properties of an Inventory. */ + interface IInventory { + + /** Inventory osShortName */ + osShortName?: (string|null); + + /** Inventory osVersion */ + osVersion?: (string|null); + } + + /** Represents an Inventory. */ + class Inventory implements IInventory { + + /** + * Constructs a new Inventory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.IInventory); + + /** Inventory osShortName. */ + public osShortName: string; + + /** Inventory osVersion. */ + public osVersion: string; + + /** + * Creates a new Inventory instance using the specified properties. + * @param [properties] Properties to set + * @returns Inventory instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.IInventory): google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory; + + /** + * Verifies an Inventory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Inventory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Inventory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @param message Inventory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Inventory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Inventory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Rollout. */ + interface IRollout { + + /** Rollout disruptionBudget */ + disruptionBudget?: (google.cloud.osconfig.v1.IFixedOrPercent|null); + + /** Rollout minWaitDuration */ + minWaitDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a Rollout. */ + class Rollout implements IRollout { + + /** + * Constructs a new Rollout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.OSPolicyAssignment.IRollout); + + /** Rollout disruptionBudget. */ + public disruptionBudget?: (google.cloud.osconfig.v1.IFixedOrPercent|null); + + /** Rollout minWaitDuration. */ + public minWaitDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new Rollout instance using the specified properties. + * @param [properties] Properties to set + * @returns Rollout instance + */ + public static create(properties?: google.cloud.osconfig.v1.OSPolicyAssignment.IRollout): google.cloud.osconfig.v1.OSPolicyAssignment.Rollout; + + /** + * Encodes the specified Rollout message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.Rollout.verify|verify} messages. + * @param message Rollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.OSPolicyAssignment.IRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Rollout message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.Rollout.verify|verify} messages. + * @param message Rollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.OSPolicyAssignment.IRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rollout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicyAssignment.Rollout; + + /** + * Decodes a Rollout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicyAssignment.Rollout; + + /** + * Verifies a Rollout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Rollout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rollout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicyAssignment.Rollout; + + /** + * Creates a plain object from a Rollout message. Also converts values to other types if specified. + * @param message Rollout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicyAssignment.Rollout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rollout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Rollout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RolloutState enum. */ + enum RolloutState { + ROLLOUT_STATE_UNSPECIFIED = 0, + IN_PROGRESS = 1, + CANCELLING = 2, + CANCELLED = 3, + SUCCEEDED = 4 + } + } + + /** Properties of a OSPolicyAssignmentOperationMetadata. */ + interface IOSPolicyAssignmentOperationMetadata { + + /** OSPolicyAssignmentOperationMetadata osPolicyAssignment */ + osPolicyAssignment?: (string|null); + + /** OSPolicyAssignmentOperationMetadata apiMethod */ + apiMethod?: (google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.APIMethod|keyof typeof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.APIMethod|null); + + /** OSPolicyAssignmentOperationMetadata rolloutState */ + rolloutState?: (google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.RolloutState|keyof typeof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.RolloutState|null); + + /** OSPolicyAssignmentOperationMetadata rolloutStartTime */ + rolloutStartTime?: (google.protobuf.ITimestamp|null); + + /** OSPolicyAssignmentOperationMetadata rolloutUpdateTime */ + rolloutUpdateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a OSPolicyAssignmentOperationMetadata. */ + class OSPolicyAssignmentOperationMetadata implements IOSPolicyAssignmentOperationMetadata { + + /** + * Constructs a new OSPolicyAssignmentOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata); + + /** OSPolicyAssignmentOperationMetadata osPolicyAssignment. */ + public osPolicyAssignment: string; + + /** OSPolicyAssignmentOperationMetadata apiMethod. */ + public apiMethod: (google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.APIMethod|keyof typeof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.APIMethod); + + /** OSPolicyAssignmentOperationMetadata rolloutState. */ + public rolloutState: (google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.RolloutState|keyof typeof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.RolloutState); + + /** OSPolicyAssignmentOperationMetadata rolloutStartTime. */ + public rolloutStartTime?: (google.protobuf.ITimestamp|null); + + /** OSPolicyAssignmentOperationMetadata rolloutUpdateTime. */ + public rolloutUpdateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OSPolicyAssignmentOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyAssignmentOperationMetadata instance + */ + public static create(properties?: google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata): google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata; + + /** + * Encodes the specified OSPolicyAssignmentOperationMetadata message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.verify|verify} messages. + * @param message OSPolicyAssignmentOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyAssignmentOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.verify|verify} messages. + * @param message OSPolicyAssignmentOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyAssignmentOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyAssignmentOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata; + + /** + * Decodes a OSPolicyAssignmentOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyAssignmentOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata; + + /** + * Verifies a OSPolicyAssignmentOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyAssignmentOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyAssignmentOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata; + + /** + * Creates a plain object from a OSPolicyAssignmentOperationMetadata message. Also converts values to other types if specified. + * @param message OSPolicyAssignmentOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyAssignmentOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyAssignmentOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyAssignmentOperationMetadata { + + /** APIMethod enum. */ + enum APIMethod { + API_METHOD_UNSPECIFIED = 0, + CREATE = 1, + UPDATE = 2, + DELETE = 3 + } + + /** RolloutState enum. */ + enum RolloutState { + ROLLOUT_STATE_UNSPECIFIED = 0, + IN_PROGRESS = 1, + CANCELLING = 2, + CANCELLED = 3, + SUCCEEDED = 4 + } + } + + /** Properties of a CreateOSPolicyAssignmentRequest. */ + interface ICreateOSPolicyAssignmentRequest { + + /** CreateOSPolicyAssignmentRequest parent */ + parent?: (string|null); + + /** CreateOSPolicyAssignmentRequest osPolicyAssignment */ + osPolicyAssignment?: (google.cloud.osconfig.v1.IOSPolicyAssignment|null); + + /** CreateOSPolicyAssignmentRequest osPolicyAssignmentId */ + osPolicyAssignmentId?: (string|null); + } + + /** Represents a CreateOSPolicyAssignmentRequest. */ + class CreateOSPolicyAssignmentRequest implements ICreateOSPolicyAssignmentRequest { + + /** + * Constructs a new CreateOSPolicyAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest); + + /** CreateOSPolicyAssignmentRequest parent. */ + public parent: string; + + /** CreateOSPolicyAssignmentRequest osPolicyAssignment. */ + public osPolicyAssignment?: (google.cloud.osconfig.v1.IOSPolicyAssignment|null); + + /** CreateOSPolicyAssignmentRequest osPolicyAssignmentId. */ + public osPolicyAssignmentId: string; + + /** + * Creates a new CreateOSPolicyAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateOSPolicyAssignmentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest): google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest; + + /** + * Encodes the specified CreateOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest.verify|verify} messages. + * @param message CreateOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest.verify|verify} messages. + * @param message CreateOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateOSPolicyAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest; + + /** + * Decodes a CreateOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest; + + /** + * Verifies a CreateOSPolicyAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateOSPolicyAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest; + + /** + * Creates a plain object from a CreateOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @param message CreateOSPolicyAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateOSPolicyAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateOSPolicyAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateOSPolicyAssignmentRequest. */ + interface IUpdateOSPolicyAssignmentRequest { + + /** UpdateOSPolicyAssignmentRequest osPolicyAssignment */ + osPolicyAssignment?: (google.cloud.osconfig.v1.IOSPolicyAssignment|null); + + /** UpdateOSPolicyAssignmentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateOSPolicyAssignmentRequest. */ + class UpdateOSPolicyAssignmentRequest implements IUpdateOSPolicyAssignmentRequest { + + /** + * Constructs a new UpdateOSPolicyAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest); + + /** UpdateOSPolicyAssignmentRequest osPolicyAssignment. */ + public osPolicyAssignment?: (google.cloud.osconfig.v1.IOSPolicyAssignment|null); + + /** UpdateOSPolicyAssignmentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateOSPolicyAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOSPolicyAssignmentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest): google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest; + + /** + * Encodes the specified UpdateOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest.verify|verify} messages. + * @param message UpdateOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest.verify|verify} messages. + * @param message UpdateOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateOSPolicyAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest; + + /** + * Decodes an UpdateOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest; + + /** + * Verifies an UpdateOSPolicyAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOSPolicyAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest; + + /** + * Creates a plain object from an UpdateOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @param message UpdateOSPolicyAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOSPolicyAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateOSPolicyAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOSPolicyAssignmentRequest. */ + interface IGetOSPolicyAssignmentRequest { + + /** GetOSPolicyAssignmentRequest name */ + name?: (string|null); + } + + /** Represents a GetOSPolicyAssignmentRequest. */ + class GetOSPolicyAssignmentRequest implements IGetOSPolicyAssignmentRequest { + + /** + * Constructs a new GetOSPolicyAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest); + + /** GetOSPolicyAssignmentRequest name. */ + public name: string; + + /** + * Creates a new GetOSPolicyAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOSPolicyAssignmentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest): google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest; + + /** + * Encodes the specified GetOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest.verify|verify} messages. + * @param message GetOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest.verify|verify} messages. + * @param message GetOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOSPolicyAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest; + + /** + * Decodes a GetOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest; + + /** + * Verifies a GetOSPolicyAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOSPolicyAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest; + + /** + * Creates a plain object from a GetOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @param message GetOSPolicyAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOSPolicyAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOSPolicyAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOSPolicyAssignmentsRequest. */ + interface IListOSPolicyAssignmentsRequest { + + /** ListOSPolicyAssignmentsRequest parent */ + parent?: (string|null); + + /** ListOSPolicyAssignmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListOSPolicyAssignmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOSPolicyAssignmentsRequest. */ + class ListOSPolicyAssignmentsRequest implements IListOSPolicyAssignmentsRequest { + + /** + * Constructs a new ListOSPolicyAssignmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest); + + /** ListOSPolicyAssignmentsRequest parent. */ + public parent: string; + + /** ListOSPolicyAssignmentsRequest pageSize. */ + public pageSize: number; + + /** ListOSPolicyAssignmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOSPolicyAssignmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOSPolicyAssignmentsRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest): google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest; + + /** + * Encodes the specified ListOSPolicyAssignmentsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest.verify|verify} messages. + * @param message ListOSPolicyAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOSPolicyAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest.verify|verify} messages. + * @param message ListOSPolicyAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOSPolicyAssignmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOSPolicyAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest; + + /** + * Decodes a ListOSPolicyAssignmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOSPolicyAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest; + + /** + * Verifies a ListOSPolicyAssignmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOSPolicyAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOSPolicyAssignmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest; + + /** + * Creates a plain object from a ListOSPolicyAssignmentsRequest message. Also converts values to other types if specified. + * @param message ListOSPolicyAssignmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOSPolicyAssignmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOSPolicyAssignmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOSPolicyAssignmentsResponse. */ + interface IListOSPolicyAssignmentsResponse { + + /** ListOSPolicyAssignmentsResponse osPolicyAssignments */ + osPolicyAssignments?: (google.cloud.osconfig.v1.IOSPolicyAssignment[]|null); + + /** ListOSPolicyAssignmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOSPolicyAssignmentsResponse. */ + class ListOSPolicyAssignmentsResponse implements IListOSPolicyAssignmentsResponse { + + /** + * Constructs a new ListOSPolicyAssignmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse); + + /** ListOSPolicyAssignmentsResponse osPolicyAssignments. */ + public osPolicyAssignments: google.cloud.osconfig.v1.IOSPolicyAssignment[]; + + /** ListOSPolicyAssignmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOSPolicyAssignmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOSPolicyAssignmentsResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse): google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse; + + /** + * Encodes the specified ListOSPolicyAssignmentsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse.verify|verify} messages. + * @param message ListOSPolicyAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOSPolicyAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse.verify|verify} messages. + * @param message ListOSPolicyAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOSPolicyAssignmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOSPolicyAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse; + + /** + * Decodes a ListOSPolicyAssignmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOSPolicyAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse; + + /** + * Verifies a ListOSPolicyAssignmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOSPolicyAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOSPolicyAssignmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse; + + /** + * Creates a plain object from a ListOSPolicyAssignmentsResponse message. Also converts values to other types if specified. + * @param message ListOSPolicyAssignmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOSPolicyAssignmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOSPolicyAssignmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOSPolicyAssignmentRevisionsRequest. */ + interface IListOSPolicyAssignmentRevisionsRequest { + + /** ListOSPolicyAssignmentRevisionsRequest name */ + name?: (string|null); + + /** ListOSPolicyAssignmentRevisionsRequest pageSize */ + pageSize?: (number|null); + + /** ListOSPolicyAssignmentRevisionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOSPolicyAssignmentRevisionsRequest. */ + class ListOSPolicyAssignmentRevisionsRequest implements IListOSPolicyAssignmentRevisionsRequest { + + /** + * Constructs a new ListOSPolicyAssignmentRevisionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest); + + /** ListOSPolicyAssignmentRevisionsRequest name. */ + public name: string; + + /** ListOSPolicyAssignmentRevisionsRequest pageSize. */ + public pageSize: number; + + /** ListOSPolicyAssignmentRevisionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOSPolicyAssignmentRevisionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOSPolicyAssignmentRevisionsRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest): google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest.verify|verify} messages. + * @param message ListOSPolicyAssignmentRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest.verify|verify} messages. + * @param message ListOSPolicyAssignmentRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOSPolicyAssignmentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOSPolicyAssignmentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest; + + /** + * Verifies a ListOSPolicyAssignmentRevisionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOSPolicyAssignmentRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOSPolicyAssignmentRevisionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest; + + /** + * Creates a plain object from a ListOSPolicyAssignmentRevisionsRequest message. Also converts values to other types if specified. + * @param message ListOSPolicyAssignmentRevisionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOSPolicyAssignmentRevisionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOSPolicyAssignmentRevisionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOSPolicyAssignmentRevisionsResponse. */ + interface IListOSPolicyAssignmentRevisionsResponse { + + /** ListOSPolicyAssignmentRevisionsResponse osPolicyAssignments */ + osPolicyAssignments?: (google.cloud.osconfig.v1.IOSPolicyAssignment[]|null); + + /** ListOSPolicyAssignmentRevisionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOSPolicyAssignmentRevisionsResponse. */ + class ListOSPolicyAssignmentRevisionsResponse implements IListOSPolicyAssignmentRevisionsResponse { + + /** + * Constructs a new ListOSPolicyAssignmentRevisionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse); + + /** ListOSPolicyAssignmentRevisionsResponse osPolicyAssignments. */ + public osPolicyAssignments: google.cloud.osconfig.v1.IOSPolicyAssignment[]; + + /** ListOSPolicyAssignmentRevisionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOSPolicyAssignmentRevisionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOSPolicyAssignmentRevisionsResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse): google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse.verify|verify} messages. + * @param message ListOSPolicyAssignmentRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse.verify|verify} messages. + * @param message ListOSPolicyAssignmentRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOSPolicyAssignmentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOSPolicyAssignmentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse; + + /** + * Verifies a ListOSPolicyAssignmentRevisionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOSPolicyAssignmentRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOSPolicyAssignmentRevisionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse; + + /** + * Creates a plain object from a ListOSPolicyAssignmentRevisionsResponse message. Also converts values to other types if specified. + * @param message ListOSPolicyAssignmentRevisionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOSPolicyAssignmentRevisionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOSPolicyAssignmentRevisionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOSPolicyAssignmentRequest. */ + interface IDeleteOSPolicyAssignmentRequest { + + /** DeleteOSPolicyAssignmentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOSPolicyAssignmentRequest. */ + class DeleteOSPolicyAssignmentRequest implements IDeleteOSPolicyAssignmentRequest { + + /** + * Constructs a new DeleteOSPolicyAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest); + + /** DeleteOSPolicyAssignmentRequest name. */ + public name: string; + + /** + * Creates a new DeleteOSPolicyAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOSPolicyAssignmentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest): google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest; + + /** + * Encodes the specified DeleteOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest.verify|verify} messages. + * @param message DeleteOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest.verify|verify} messages. + * @param message DeleteOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOSPolicyAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest; + + /** + * Decodes a DeleteOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest; + + /** + * Verifies a DeleteOSPolicyAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOSPolicyAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest; + + /** + * Creates a plain object from a DeleteOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @param message DeleteOSPolicyAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOSPolicyAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOSPolicyAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedOrPercent. */ + interface IFixedOrPercent { + + /** FixedOrPercent fixed */ + fixed?: (number|null); + + /** FixedOrPercent percent */ + percent?: (number|null); + } + + /** Represents a FixedOrPercent. */ + class FixedOrPercent implements IFixedOrPercent { + + /** + * Constructs a new FixedOrPercent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IFixedOrPercent); + + /** FixedOrPercent fixed. */ + public fixed?: (number|null); + + /** FixedOrPercent percent. */ + public percent?: (number|null); + + /** FixedOrPercent mode. */ + public mode?: ("fixed"|"percent"); + + /** + * Creates a new FixedOrPercent instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedOrPercent instance + */ + public static create(properties?: google.cloud.osconfig.v1.IFixedOrPercent): google.cloud.osconfig.v1.FixedOrPercent; + + /** + * Encodes the specified FixedOrPercent message. Does not implicitly {@link google.cloud.osconfig.v1.FixedOrPercent.verify|verify} messages. + * @param message FixedOrPercent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IFixedOrPercent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FixedOrPercent message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.FixedOrPercent.verify|verify} messages. + * @param message FixedOrPercent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IFixedOrPercent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedOrPercent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FixedOrPercent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.FixedOrPercent; + + /** + * Decodes a FixedOrPercent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FixedOrPercent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.FixedOrPercent; + + /** + * Verifies a FixedOrPercent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FixedOrPercent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FixedOrPercent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.FixedOrPercent; + + /** + * Creates a plain object from a FixedOrPercent message. Also converts values to other types if specified. + * @param message FixedOrPercent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.FixedOrPercent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FixedOrPercent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FixedOrPercent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an OsConfigService */ + class OsConfigService extends $protobuf.rpc.Service { + + /** + * Constructs a new OsConfigService 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 OsConfigService 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): OsConfigService; + + /** + * Calls ExecutePatchJob. + * @param request ExecutePatchJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PatchJob + */ + public executePatchJob(request: google.cloud.osconfig.v1.IExecutePatchJobRequest, callback: google.cloud.osconfig.v1.OsConfigService.ExecutePatchJobCallback): void; + + /** + * Calls ExecutePatchJob. + * @param request ExecutePatchJobRequest message or plain object + * @returns Promise + */ + public executePatchJob(request: google.cloud.osconfig.v1.IExecutePatchJobRequest): Promise; + + /** + * Calls GetPatchJob. + * @param request GetPatchJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PatchJob + */ + public getPatchJob(request: google.cloud.osconfig.v1.IGetPatchJobRequest, callback: google.cloud.osconfig.v1.OsConfigService.GetPatchJobCallback): void; + + /** + * Calls GetPatchJob. + * @param request GetPatchJobRequest message or plain object + * @returns Promise + */ + public getPatchJob(request: google.cloud.osconfig.v1.IGetPatchJobRequest): Promise; + + /** + * Calls CancelPatchJob. + * @param request CancelPatchJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PatchJob + */ + public cancelPatchJob(request: google.cloud.osconfig.v1.ICancelPatchJobRequest, callback: google.cloud.osconfig.v1.OsConfigService.CancelPatchJobCallback): void; + + /** + * Calls CancelPatchJob. + * @param request CancelPatchJobRequest message or plain object + * @returns Promise + */ + public cancelPatchJob(request: google.cloud.osconfig.v1.ICancelPatchJobRequest): Promise; + + /** + * Calls ListPatchJobs. + * @param request ListPatchJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPatchJobsResponse + */ + public listPatchJobs(request: google.cloud.osconfig.v1.IListPatchJobsRequest, callback: google.cloud.osconfig.v1.OsConfigService.ListPatchJobsCallback): void; + + /** + * Calls ListPatchJobs. + * @param request ListPatchJobsRequest message or plain object + * @returns Promise + */ + public listPatchJobs(request: google.cloud.osconfig.v1.IListPatchJobsRequest): Promise; + + /** + * Calls ListPatchJobInstanceDetails. + * @param request ListPatchJobInstanceDetailsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPatchJobInstanceDetailsResponse + */ + public listPatchJobInstanceDetails(request: google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, callback: google.cloud.osconfig.v1.OsConfigService.ListPatchJobInstanceDetailsCallback): void; + + /** + * Calls ListPatchJobInstanceDetails. + * @param request ListPatchJobInstanceDetailsRequest message or plain object + * @returns Promise + */ + public listPatchJobInstanceDetails(request: google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest): Promise; + + /** + * Calls CreatePatchDeployment. + * @param request CreatePatchDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PatchDeployment + */ + public createPatchDeployment(request: google.cloud.osconfig.v1.ICreatePatchDeploymentRequest, callback: google.cloud.osconfig.v1.OsConfigService.CreatePatchDeploymentCallback): void; + + /** + * Calls CreatePatchDeployment. + * @param request CreatePatchDeploymentRequest message or plain object + * @returns Promise + */ + public createPatchDeployment(request: google.cloud.osconfig.v1.ICreatePatchDeploymentRequest): Promise; + + /** + * Calls GetPatchDeployment. + * @param request GetPatchDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PatchDeployment + */ + public getPatchDeployment(request: google.cloud.osconfig.v1.IGetPatchDeploymentRequest, callback: google.cloud.osconfig.v1.OsConfigService.GetPatchDeploymentCallback): void; + + /** + * Calls GetPatchDeployment. + * @param request GetPatchDeploymentRequest message or plain object + * @returns Promise + */ + public getPatchDeployment(request: google.cloud.osconfig.v1.IGetPatchDeploymentRequest): Promise; + + /** + * Calls ListPatchDeployments. + * @param request ListPatchDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPatchDeploymentsResponse + */ + public listPatchDeployments(request: google.cloud.osconfig.v1.IListPatchDeploymentsRequest, callback: google.cloud.osconfig.v1.OsConfigService.ListPatchDeploymentsCallback): void; + + /** + * Calls ListPatchDeployments. + * @param request ListPatchDeploymentsRequest message or plain object + * @returns Promise + */ + public listPatchDeployments(request: google.cloud.osconfig.v1.IListPatchDeploymentsRequest): Promise; + + /** + * Calls DeletePatchDeployment. + * @param request DeletePatchDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePatchDeployment(request: google.cloud.osconfig.v1.IDeletePatchDeploymentRequest, callback: google.cloud.osconfig.v1.OsConfigService.DeletePatchDeploymentCallback): void; + + /** + * Calls DeletePatchDeployment. + * @param request DeletePatchDeploymentRequest message or plain object + * @returns Promise + */ + public deletePatchDeployment(request: google.cloud.osconfig.v1.IDeletePatchDeploymentRequest): Promise; + + /** + * Calls UpdatePatchDeployment. + * @param request UpdatePatchDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PatchDeployment + */ + public updatePatchDeployment(request: google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest, callback: google.cloud.osconfig.v1.OsConfigService.UpdatePatchDeploymentCallback): void; + + /** + * Calls UpdatePatchDeployment. + * @param request UpdatePatchDeploymentRequest message or plain object + * @returns Promise + */ + public updatePatchDeployment(request: google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest): Promise; + + /** + * Calls PausePatchDeployment. + * @param request PausePatchDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PatchDeployment + */ + public pausePatchDeployment(request: google.cloud.osconfig.v1.IPausePatchDeploymentRequest, callback: google.cloud.osconfig.v1.OsConfigService.PausePatchDeploymentCallback): void; + + /** + * Calls PausePatchDeployment. + * @param request PausePatchDeploymentRequest message or plain object + * @returns Promise + */ + public pausePatchDeployment(request: google.cloud.osconfig.v1.IPausePatchDeploymentRequest): Promise; + + /** + * Calls ResumePatchDeployment. + * @param request ResumePatchDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PatchDeployment + */ + public resumePatchDeployment(request: google.cloud.osconfig.v1.IResumePatchDeploymentRequest, callback: google.cloud.osconfig.v1.OsConfigService.ResumePatchDeploymentCallback): void; + + /** + * Calls ResumePatchDeployment. + * @param request ResumePatchDeploymentRequest message or plain object + * @returns Promise + */ + public resumePatchDeployment(request: google.cloud.osconfig.v1.IResumePatchDeploymentRequest): Promise; + } + + namespace OsConfigService { + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|executePatchJob}. + * @param error Error, if any + * @param [response] PatchJob + */ + type ExecutePatchJobCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.PatchJob) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|getPatchJob}. + * @param error Error, if any + * @param [response] PatchJob + */ + type GetPatchJobCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.PatchJob) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|cancelPatchJob}. + * @param error Error, if any + * @param [response] PatchJob + */ + type CancelPatchJobCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.PatchJob) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|listPatchJobs}. + * @param error Error, if any + * @param [response] ListPatchJobsResponse + */ + type ListPatchJobsCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.ListPatchJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|listPatchJobInstanceDetails}. + * @param error Error, if any + * @param [response] ListPatchJobInstanceDetailsResponse + */ + type ListPatchJobInstanceDetailsCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|createPatchDeployment}. + * @param error Error, if any + * @param [response] PatchDeployment + */ + type CreatePatchDeploymentCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.PatchDeployment) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|getPatchDeployment}. + * @param error Error, if any + * @param [response] PatchDeployment + */ + type GetPatchDeploymentCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.PatchDeployment) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|listPatchDeployments}. + * @param error Error, if any + * @param [response] ListPatchDeploymentsResponse + */ + type ListPatchDeploymentsCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.ListPatchDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|deletePatchDeployment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePatchDeploymentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|updatePatchDeployment}. + * @param error Error, if any + * @param [response] PatchDeployment + */ + type UpdatePatchDeploymentCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.PatchDeployment) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|pausePatchDeployment}. + * @param error Error, if any + * @param [response] PatchDeployment + */ + type PausePatchDeploymentCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.PatchDeployment) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|resumePatchDeployment}. + * @param error Error, if any + * @param [response] PatchDeployment + */ + type ResumePatchDeploymentCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.PatchDeployment) => void; + } + + /** Properties of a PatchDeployment. */ + interface IPatchDeployment { + + /** PatchDeployment name */ + name?: (string|null); + + /** PatchDeployment description */ + description?: (string|null); + + /** PatchDeployment instanceFilter */ + instanceFilter?: (google.cloud.osconfig.v1.IPatchInstanceFilter|null); + + /** PatchDeployment patchConfig */ + patchConfig?: (google.cloud.osconfig.v1.IPatchConfig|null); + + /** PatchDeployment duration */ + duration?: (google.protobuf.IDuration|null); + + /** PatchDeployment oneTimeSchedule */ + oneTimeSchedule?: (google.cloud.osconfig.v1.IOneTimeSchedule|null); + + /** PatchDeployment recurringSchedule */ + recurringSchedule?: (google.cloud.osconfig.v1.IRecurringSchedule|null); + + /** PatchDeployment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** PatchDeployment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** PatchDeployment lastExecuteTime */ + lastExecuteTime?: (google.protobuf.ITimestamp|null); + + /** PatchDeployment rollout */ + rollout?: (google.cloud.osconfig.v1.IPatchRollout|null); + + /** PatchDeployment state */ + state?: (google.cloud.osconfig.v1.PatchDeployment.State|keyof typeof google.cloud.osconfig.v1.PatchDeployment.State|null); + } + + /** Represents a PatchDeployment. */ + class PatchDeployment implements IPatchDeployment { + + /** + * Constructs a new PatchDeployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IPatchDeployment); + + /** PatchDeployment name. */ + public name: string; + + /** PatchDeployment description. */ + public description: string; + + /** PatchDeployment instanceFilter. */ + public instanceFilter?: (google.cloud.osconfig.v1.IPatchInstanceFilter|null); + + /** PatchDeployment patchConfig. */ + public patchConfig?: (google.cloud.osconfig.v1.IPatchConfig|null); + + /** PatchDeployment duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** PatchDeployment oneTimeSchedule. */ + public oneTimeSchedule?: (google.cloud.osconfig.v1.IOneTimeSchedule|null); + + /** PatchDeployment recurringSchedule. */ + public recurringSchedule?: (google.cloud.osconfig.v1.IRecurringSchedule|null); + + /** PatchDeployment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** PatchDeployment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** PatchDeployment lastExecuteTime. */ + public lastExecuteTime?: (google.protobuf.ITimestamp|null); + + /** PatchDeployment rollout. */ + public rollout?: (google.cloud.osconfig.v1.IPatchRollout|null); + + /** PatchDeployment state. */ + public state: (google.cloud.osconfig.v1.PatchDeployment.State|keyof typeof google.cloud.osconfig.v1.PatchDeployment.State); + + /** PatchDeployment schedule. */ + public schedule?: ("oneTimeSchedule"|"recurringSchedule"); + + /** + * Creates a new PatchDeployment instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchDeployment instance + */ + public static create(properties?: google.cloud.osconfig.v1.IPatchDeployment): google.cloud.osconfig.v1.PatchDeployment; + + /** + * Encodes the specified PatchDeployment message. Does not implicitly {@link google.cloud.osconfig.v1.PatchDeployment.verify|verify} messages. + * @param message PatchDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IPatchDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchDeployment message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchDeployment.verify|verify} messages. + * @param message PatchDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IPatchDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchDeployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.PatchDeployment; + + /** + * Decodes a PatchDeployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.PatchDeployment; + + /** + * Verifies a PatchDeployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchDeployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchDeployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.PatchDeployment; + + /** + * Creates a plain object from a PatchDeployment message. Also converts values to other types if specified. + * @param message PatchDeployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.PatchDeployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchDeployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PatchDeployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PatchDeployment { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + PAUSED = 2 + } + } + + /** Properties of an OneTimeSchedule. */ + interface IOneTimeSchedule { + + /** OneTimeSchedule executeTime */ + executeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OneTimeSchedule. */ + class OneTimeSchedule implements IOneTimeSchedule { + + /** + * Constructs a new OneTimeSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IOneTimeSchedule); + + /** OneTimeSchedule executeTime. */ + public executeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OneTimeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns OneTimeSchedule instance + */ + public static create(properties?: google.cloud.osconfig.v1.IOneTimeSchedule): google.cloud.osconfig.v1.OneTimeSchedule; + + /** + * Encodes the specified OneTimeSchedule message. Does not implicitly {@link google.cloud.osconfig.v1.OneTimeSchedule.verify|verify} messages. + * @param message OneTimeSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IOneTimeSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneTimeSchedule message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OneTimeSchedule.verify|verify} messages. + * @param message OneTimeSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IOneTimeSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneTimeSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneTimeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.OneTimeSchedule; + + /** + * Decodes an OneTimeSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneTimeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.OneTimeSchedule; + + /** + * Verifies an OneTimeSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneTimeSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneTimeSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.OneTimeSchedule; + + /** + * Creates a plain object from an OneTimeSchedule message. Also converts values to other types if specified. + * @param message OneTimeSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.OneTimeSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneTimeSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneTimeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecurringSchedule. */ + interface IRecurringSchedule { + + /** RecurringSchedule timeZone */ + timeZone?: (google.type.ITimeZone|null); + + /** RecurringSchedule startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** RecurringSchedule endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** RecurringSchedule timeOfDay */ + timeOfDay?: (google.type.ITimeOfDay|null); + + /** RecurringSchedule frequency */ + frequency?: (google.cloud.osconfig.v1.RecurringSchedule.Frequency|keyof typeof google.cloud.osconfig.v1.RecurringSchedule.Frequency|null); + + /** RecurringSchedule weekly */ + weekly?: (google.cloud.osconfig.v1.IWeeklySchedule|null); + + /** RecurringSchedule monthly */ + monthly?: (google.cloud.osconfig.v1.IMonthlySchedule|null); + + /** RecurringSchedule lastExecuteTime */ + lastExecuteTime?: (google.protobuf.ITimestamp|null); + + /** RecurringSchedule nextExecuteTime */ + nextExecuteTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a RecurringSchedule. */ + class RecurringSchedule implements IRecurringSchedule { + + /** + * Constructs a new RecurringSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IRecurringSchedule); + + /** RecurringSchedule timeZone. */ + public timeZone?: (google.type.ITimeZone|null); + + /** RecurringSchedule startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** RecurringSchedule endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** RecurringSchedule timeOfDay. */ + public timeOfDay?: (google.type.ITimeOfDay|null); + + /** RecurringSchedule frequency. */ + public frequency: (google.cloud.osconfig.v1.RecurringSchedule.Frequency|keyof typeof google.cloud.osconfig.v1.RecurringSchedule.Frequency); + + /** RecurringSchedule weekly. */ + public weekly?: (google.cloud.osconfig.v1.IWeeklySchedule|null); + + /** RecurringSchedule monthly. */ + public monthly?: (google.cloud.osconfig.v1.IMonthlySchedule|null); + + /** RecurringSchedule lastExecuteTime. */ + public lastExecuteTime?: (google.protobuf.ITimestamp|null); + + /** RecurringSchedule nextExecuteTime. */ + public nextExecuteTime?: (google.protobuf.ITimestamp|null); + + /** RecurringSchedule scheduleConfig. */ + public scheduleConfig?: ("weekly"|"monthly"); + + /** + * Creates a new RecurringSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns RecurringSchedule instance + */ + public static create(properties?: google.cloud.osconfig.v1.IRecurringSchedule): google.cloud.osconfig.v1.RecurringSchedule; + + /** + * Encodes the specified RecurringSchedule message. Does not implicitly {@link google.cloud.osconfig.v1.RecurringSchedule.verify|verify} messages. + * @param message RecurringSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IRecurringSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecurringSchedule message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.RecurringSchedule.verify|verify} messages. + * @param message RecurringSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IRecurringSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecurringSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecurringSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.RecurringSchedule; + + /** + * Decodes a RecurringSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecurringSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.RecurringSchedule; + + /** + * Verifies a RecurringSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecurringSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecurringSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.RecurringSchedule; + + /** + * Creates a plain object from a RecurringSchedule message. Also converts values to other types if specified. + * @param message RecurringSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.RecurringSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecurringSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecurringSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RecurringSchedule { + + /** Frequency enum. */ + enum Frequency { + FREQUENCY_UNSPECIFIED = 0, + WEEKLY = 1, + MONTHLY = 2, + DAILY = 3 + } + } + + /** Properties of a WeeklySchedule. */ + interface IWeeklySchedule { + + /** WeeklySchedule dayOfWeek */ + dayOfWeek?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); + } + + /** Represents a WeeklySchedule. */ + class WeeklySchedule implements IWeeklySchedule { + + /** + * Constructs a new WeeklySchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IWeeklySchedule); + + /** WeeklySchedule dayOfWeek. */ + public dayOfWeek: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); + + /** + * Creates a new WeeklySchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns WeeklySchedule instance + */ + public static create(properties?: google.cloud.osconfig.v1.IWeeklySchedule): google.cloud.osconfig.v1.WeeklySchedule; + + /** + * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.osconfig.v1.WeeklySchedule.verify|verify} messages. + * @param message WeeklySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.WeeklySchedule.verify|verify} messages. + * @param message WeeklySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.WeeklySchedule; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.WeeklySchedule; + + /** + * Verifies a WeeklySchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeeklySchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.WeeklySchedule; + + /** + * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. + * @param message WeeklySchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.WeeklySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeeklySchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WeeklySchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MonthlySchedule. */ + interface IMonthlySchedule { + + /** MonthlySchedule weekDayOfMonth */ + weekDayOfMonth?: (google.cloud.osconfig.v1.IWeekDayOfMonth|null); + + /** MonthlySchedule monthDay */ + monthDay?: (number|null); + } + + /** Represents a MonthlySchedule. */ + class MonthlySchedule implements IMonthlySchedule { + + /** + * Constructs a new MonthlySchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IMonthlySchedule); + + /** MonthlySchedule weekDayOfMonth. */ + public weekDayOfMonth?: (google.cloud.osconfig.v1.IWeekDayOfMonth|null); + + /** MonthlySchedule monthDay. */ + public monthDay?: (number|null); + + /** MonthlySchedule dayOfMonth. */ + public dayOfMonth?: ("weekDayOfMonth"|"monthDay"); + + /** + * Creates a new MonthlySchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns MonthlySchedule instance + */ + public static create(properties?: google.cloud.osconfig.v1.IMonthlySchedule): google.cloud.osconfig.v1.MonthlySchedule; + + /** + * Encodes the specified MonthlySchedule message. Does not implicitly {@link google.cloud.osconfig.v1.MonthlySchedule.verify|verify} messages. + * @param message MonthlySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IMonthlySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MonthlySchedule message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.MonthlySchedule.verify|verify} messages. + * @param message MonthlySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IMonthlySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MonthlySchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MonthlySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.MonthlySchedule; + + /** + * Decodes a MonthlySchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MonthlySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.MonthlySchedule; + + /** + * Verifies a MonthlySchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MonthlySchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MonthlySchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.MonthlySchedule; + + /** + * Creates a plain object from a MonthlySchedule message. Also converts values to other types if specified. + * @param message MonthlySchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.MonthlySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MonthlySchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MonthlySchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WeekDayOfMonth. */ + interface IWeekDayOfMonth { + + /** WeekDayOfMonth weekOrdinal */ + weekOrdinal?: (number|null); + + /** WeekDayOfMonth dayOfWeek */ + dayOfWeek?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); + + /** WeekDayOfMonth dayOffset */ + dayOffset?: (number|null); + } + + /** Represents a WeekDayOfMonth. */ + class WeekDayOfMonth implements IWeekDayOfMonth { + + /** + * Constructs a new WeekDayOfMonth. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IWeekDayOfMonth); + + /** WeekDayOfMonth weekOrdinal. */ + public weekOrdinal: number; + + /** WeekDayOfMonth dayOfWeek. */ + public dayOfWeek: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); + + /** WeekDayOfMonth dayOffset. */ + public dayOffset: number; + + /** + * Creates a new WeekDayOfMonth instance using the specified properties. + * @param [properties] Properties to set + * @returns WeekDayOfMonth instance + */ + public static create(properties?: google.cloud.osconfig.v1.IWeekDayOfMonth): google.cloud.osconfig.v1.WeekDayOfMonth; + + /** + * Encodes the specified WeekDayOfMonth message. Does not implicitly {@link google.cloud.osconfig.v1.WeekDayOfMonth.verify|verify} messages. + * @param message WeekDayOfMonth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IWeekDayOfMonth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeekDayOfMonth message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.WeekDayOfMonth.verify|verify} messages. + * @param message WeekDayOfMonth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IWeekDayOfMonth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.WeekDayOfMonth; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.WeekDayOfMonth; + + /** + * Verifies a WeekDayOfMonth message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WeekDayOfMonth message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeekDayOfMonth + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.WeekDayOfMonth; + + /** + * Creates a plain object from a WeekDayOfMonth message. Also converts values to other types if specified. + * @param message WeekDayOfMonth + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.WeekDayOfMonth, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeekDayOfMonth to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WeekDayOfMonth + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreatePatchDeploymentRequest. */ + interface ICreatePatchDeploymentRequest { + + /** CreatePatchDeploymentRequest parent */ + parent?: (string|null); + + /** CreatePatchDeploymentRequest patchDeploymentId */ + patchDeploymentId?: (string|null); + + /** CreatePatchDeploymentRequest patchDeployment */ + patchDeployment?: (google.cloud.osconfig.v1.IPatchDeployment|null); + } + + /** Represents a CreatePatchDeploymentRequest. */ + class CreatePatchDeploymentRequest implements ICreatePatchDeploymentRequest { + + /** + * Constructs a new CreatePatchDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.ICreatePatchDeploymentRequest); + + /** CreatePatchDeploymentRequest parent. */ + public parent: string; + + /** CreatePatchDeploymentRequest patchDeploymentId. */ + public patchDeploymentId: string; + + /** CreatePatchDeploymentRequest patchDeployment. */ + public patchDeployment?: (google.cloud.osconfig.v1.IPatchDeployment|null); + + /** + * Creates a new CreatePatchDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePatchDeploymentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.ICreatePatchDeploymentRequest): google.cloud.osconfig.v1.CreatePatchDeploymentRequest; + + /** + * Encodes the specified CreatePatchDeploymentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.CreatePatchDeploymentRequest.verify|verify} messages. + * @param message CreatePatchDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.ICreatePatchDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePatchDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.CreatePatchDeploymentRequest.verify|verify} messages. + * @param message CreatePatchDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.ICreatePatchDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePatchDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.CreatePatchDeploymentRequest; + + /** + * Decodes a CreatePatchDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.CreatePatchDeploymentRequest; + + /** + * Verifies a CreatePatchDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreatePatchDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePatchDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.CreatePatchDeploymentRequest; + + /** + * Creates a plain object from a CreatePatchDeploymentRequest message. Also converts values to other types if specified. + * @param message CreatePatchDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.CreatePatchDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePatchDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePatchDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPatchDeploymentRequest. */ + interface IGetPatchDeploymentRequest { + + /** GetPatchDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetPatchDeploymentRequest. */ + class GetPatchDeploymentRequest implements IGetPatchDeploymentRequest { + + /** + * Constructs a new GetPatchDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IGetPatchDeploymentRequest); + + /** GetPatchDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetPatchDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPatchDeploymentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IGetPatchDeploymentRequest): google.cloud.osconfig.v1.GetPatchDeploymentRequest; + + /** + * Encodes the specified GetPatchDeploymentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetPatchDeploymentRequest.verify|verify} messages. + * @param message GetPatchDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IGetPatchDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPatchDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetPatchDeploymentRequest.verify|verify} messages. + * @param message GetPatchDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IGetPatchDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPatchDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.GetPatchDeploymentRequest; + + /** + * Decodes a GetPatchDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.GetPatchDeploymentRequest; + + /** + * Verifies a GetPatchDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPatchDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPatchDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.GetPatchDeploymentRequest; + + /** + * Creates a plain object from a GetPatchDeploymentRequest message. Also converts values to other types if specified. + * @param message GetPatchDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.GetPatchDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPatchDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPatchDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPatchDeploymentsRequest. */ + interface IListPatchDeploymentsRequest { + + /** ListPatchDeploymentsRequest parent */ + parent?: (string|null); + + /** ListPatchDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListPatchDeploymentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPatchDeploymentsRequest. */ + class ListPatchDeploymentsRequest implements IListPatchDeploymentsRequest { + + /** + * Constructs a new ListPatchDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListPatchDeploymentsRequest); + + /** ListPatchDeploymentsRequest parent. */ + public parent: string; + + /** ListPatchDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListPatchDeploymentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPatchDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPatchDeploymentsRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListPatchDeploymentsRequest): google.cloud.osconfig.v1.ListPatchDeploymentsRequest; + + /** + * Encodes the specified ListPatchDeploymentsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchDeploymentsRequest.verify|verify} messages. + * @param message ListPatchDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListPatchDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPatchDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchDeploymentsRequest.verify|verify} messages. + * @param message ListPatchDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListPatchDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPatchDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPatchDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListPatchDeploymentsRequest; + + /** + * Decodes a ListPatchDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPatchDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListPatchDeploymentsRequest; + + /** + * Verifies a ListPatchDeploymentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPatchDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPatchDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListPatchDeploymentsRequest; + + /** + * Creates a plain object from a ListPatchDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListPatchDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListPatchDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPatchDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPatchDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPatchDeploymentsResponse. */ + interface IListPatchDeploymentsResponse { + + /** ListPatchDeploymentsResponse patchDeployments */ + patchDeployments?: (google.cloud.osconfig.v1.IPatchDeployment[]|null); + + /** ListPatchDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPatchDeploymentsResponse. */ + class ListPatchDeploymentsResponse implements IListPatchDeploymentsResponse { + + /** + * Constructs a new ListPatchDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListPatchDeploymentsResponse); + + /** ListPatchDeploymentsResponse patchDeployments. */ + public patchDeployments: google.cloud.osconfig.v1.IPatchDeployment[]; + + /** ListPatchDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPatchDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPatchDeploymentsResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListPatchDeploymentsResponse): google.cloud.osconfig.v1.ListPatchDeploymentsResponse; + + /** + * Encodes the specified ListPatchDeploymentsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchDeploymentsResponse.verify|verify} messages. + * @param message ListPatchDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListPatchDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPatchDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchDeploymentsResponse.verify|verify} messages. + * @param message ListPatchDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListPatchDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPatchDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPatchDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListPatchDeploymentsResponse; + + /** + * Decodes a ListPatchDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPatchDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListPatchDeploymentsResponse; + + /** + * Verifies a ListPatchDeploymentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPatchDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPatchDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListPatchDeploymentsResponse; + + /** + * Creates a plain object from a ListPatchDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListPatchDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListPatchDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPatchDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPatchDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePatchDeploymentRequest. */ + interface IDeletePatchDeploymentRequest { + + /** DeletePatchDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a DeletePatchDeploymentRequest. */ + class DeletePatchDeploymentRequest implements IDeletePatchDeploymentRequest { + + /** + * Constructs a new DeletePatchDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IDeletePatchDeploymentRequest); + + /** DeletePatchDeploymentRequest name. */ + public name: string; + + /** + * Creates a new DeletePatchDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePatchDeploymentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IDeletePatchDeploymentRequest): google.cloud.osconfig.v1.DeletePatchDeploymentRequest; + + /** + * Encodes the specified DeletePatchDeploymentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.DeletePatchDeploymentRequest.verify|verify} messages. + * @param message DeletePatchDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IDeletePatchDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePatchDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.DeletePatchDeploymentRequest.verify|verify} messages. + * @param message DeletePatchDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IDeletePatchDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePatchDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.DeletePatchDeploymentRequest; + + /** + * Decodes a DeletePatchDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.DeletePatchDeploymentRequest; + + /** + * Verifies a DeletePatchDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePatchDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePatchDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.DeletePatchDeploymentRequest; + + /** + * Creates a plain object from a DeletePatchDeploymentRequest message. Also converts values to other types if specified. + * @param message DeletePatchDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.DeletePatchDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePatchDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePatchDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePatchDeploymentRequest. */ + interface IUpdatePatchDeploymentRequest { + + /** UpdatePatchDeploymentRequest patchDeployment */ + patchDeployment?: (google.cloud.osconfig.v1.IPatchDeployment|null); + + /** UpdatePatchDeploymentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdatePatchDeploymentRequest. */ + class UpdatePatchDeploymentRequest implements IUpdatePatchDeploymentRequest { + + /** + * Constructs a new UpdatePatchDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest); + + /** UpdatePatchDeploymentRequest patchDeployment. */ + public patchDeployment?: (google.cloud.osconfig.v1.IPatchDeployment|null); + + /** UpdatePatchDeploymentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdatePatchDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePatchDeploymentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest): google.cloud.osconfig.v1.UpdatePatchDeploymentRequest; + + /** + * Encodes the specified UpdatePatchDeploymentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.UpdatePatchDeploymentRequest.verify|verify} messages. + * @param message UpdatePatchDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePatchDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.UpdatePatchDeploymentRequest.verify|verify} messages. + * @param message UpdatePatchDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePatchDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.UpdatePatchDeploymentRequest; + + /** + * Decodes an UpdatePatchDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.UpdatePatchDeploymentRequest; + + /** + * Verifies an UpdatePatchDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdatePatchDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePatchDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.UpdatePatchDeploymentRequest; + + /** + * Creates a plain object from an UpdatePatchDeploymentRequest message. Also converts values to other types if specified. + * @param message UpdatePatchDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.UpdatePatchDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePatchDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePatchDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PausePatchDeploymentRequest. */ + interface IPausePatchDeploymentRequest { + + /** PausePatchDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a PausePatchDeploymentRequest. */ + class PausePatchDeploymentRequest implements IPausePatchDeploymentRequest { + + /** + * Constructs a new PausePatchDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IPausePatchDeploymentRequest); + + /** PausePatchDeploymentRequest name. */ + public name: string; + + /** + * Creates a new PausePatchDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PausePatchDeploymentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IPausePatchDeploymentRequest): google.cloud.osconfig.v1.PausePatchDeploymentRequest; + + /** + * Encodes the specified PausePatchDeploymentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.PausePatchDeploymentRequest.verify|verify} messages. + * @param message PausePatchDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IPausePatchDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PausePatchDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PausePatchDeploymentRequest.verify|verify} messages. + * @param message PausePatchDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IPausePatchDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PausePatchDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PausePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.PausePatchDeploymentRequest; + + /** + * Decodes a PausePatchDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PausePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.PausePatchDeploymentRequest; + + /** + * Verifies a PausePatchDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PausePatchDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PausePatchDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.PausePatchDeploymentRequest; + + /** + * Creates a plain object from a PausePatchDeploymentRequest message. Also converts values to other types if specified. + * @param message PausePatchDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.PausePatchDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PausePatchDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PausePatchDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResumePatchDeploymentRequest. */ + interface IResumePatchDeploymentRequest { + + /** ResumePatchDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a ResumePatchDeploymentRequest. */ + class ResumePatchDeploymentRequest implements IResumePatchDeploymentRequest { + + /** + * Constructs a new ResumePatchDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IResumePatchDeploymentRequest); + + /** ResumePatchDeploymentRequest name. */ + public name: string; + + /** + * Creates a new ResumePatchDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResumePatchDeploymentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IResumePatchDeploymentRequest): google.cloud.osconfig.v1.ResumePatchDeploymentRequest; + + /** + * Encodes the specified ResumePatchDeploymentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ResumePatchDeploymentRequest.verify|verify} messages. + * @param message ResumePatchDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IResumePatchDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResumePatchDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ResumePatchDeploymentRequest.verify|verify} messages. + * @param message ResumePatchDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IResumePatchDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResumePatchDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResumePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ResumePatchDeploymentRequest; + + /** + * Decodes a ResumePatchDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResumePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ResumePatchDeploymentRequest; + + /** + * Verifies a ResumePatchDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResumePatchDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResumePatchDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ResumePatchDeploymentRequest; + + /** + * Creates a plain object from a ResumePatchDeploymentRequest message. Also converts values to other types if specified. + * @param message ResumePatchDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ResumePatchDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResumePatchDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResumePatchDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecutePatchJobRequest. */ + interface IExecutePatchJobRequest { + + /** ExecutePatchJobRequest parent */ + parent?: (string|null); + + /** ExecutePatchJobRequest description */ + description?: (string|null); + + /** ExecutePatchJobRequest instanceFilter */ + instanceFilter?: (google.cloud.osconfig.v1.IPatchInstanceFilter|null); + + /** ExecutePatchJobRequest patchConfig */ + patchConfig?: (google.cloud.osconfig.v1.IPatchConfig|null); + + /** ExecutePatchJobRequest duration */ + duration?: (google.protobuf.IDuration|null); + + /** ExecutePatchJobRequest dryRun */ + dryRun?: (boolean|null); + + /** ExecutePatchJobRequest displayName */ + displayName?: (string|null); + + /** ExecutePatchJobRequest rollout */ + rollout?: (google.cloud.osconfig.v1.IPatchRollout|null); + } + + /** Represents an ExecutePatchJobRequest. */ + class ExecutePatchJobRequest implements IExecutePatchJobRequest { + + /** + * Constructs a new ExecutePatchJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IExecutePatchJobRequest); + + /** ExecutePatchJobRequest parent. */ + public parent: string; + + /** ExecutePatchJobRequest description. */ + public description: string; + + /** ExecutePatchJobRequest instanceFilter. */ + public instanceFilter?: (google.cloud.osconfig.v1.IPatchInstanceFilter|null); + + /** ExecutePatchJobRequest patchConfig. */ + public patchConfig?: (google.cloud.osconfig.v1.IPatchConfig|null); + + /** ExecutePatchJobRequest duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** ExecutePatchJobRequest dryRun. */ + public dryRun: boolean; + + /** ExecutePatchJobRequest displayName. */ + public displayName: string; + + /** ExecutePatchJobRequest rollout. */ + public rollout?: (google.cloud.osconfig.v1.IPatchRollout|null); + + /** + * Creates a new ExecutePatchJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutePatchJobRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IExecutePatchJobRequest): google.cloud.osconfig.v1.ExecutePatchJobRequest; + + /** + * Encodes the specified ExecutePatchJobRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ExecutePatchJobRequest.verify|verify} messages. + * @param message ExecutePatchJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IExecutePatchJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutePatchJobRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ExecutePatchJobRequest.verify|verify} messages. + * @param message ExecutePatchJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IExecutePatchJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutePatchJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutePatchJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ExecutePatchJobRequest; + + /** + * Decodes an ExecutePatchJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutePatchJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ExecutePatchJobRequest; + + /** + * Verifies an ExecutePatchJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecutePatchJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutePatchJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ExecutePatchJobRequest; + + /** + * Creates a plain object from an ExecutePatchJobRequest message. Also converts values to other types if specified. + * @param message ExecutePatchJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ExecutePatchJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutePatchJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutePatchJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPatchJobRequest. */ + interface IGetPatchJobRequest { + + /** GetPatchJobRequest name */ + name?: (string|null); + } + + /** Represents a GetPatchJobRequest. */ + class GetPatchJobRequest implements IGetPatchJobRequest { + + /** + * Constructs a new GetPatchJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IGetPatchJobRequest); + + /** GetPatchJobRequest name. */ + public name: string; + + /** + * Creates a new GetPatchJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPatchJobRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IGetPatchJobRequest): google.cloud.osconfig.v1.GetPatchJobRequest; + + /** + * Encodes the specified GetPatchJobRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetPatchJobRequest.verify|verify} messages. + * @param message GetPatchJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IGetPatchJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPatchJobRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetPatchJobRequest.verify|verify} messages. + * @param message GetPatchJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IGetPatchJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPatchJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPatchJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.GetPatchJobRequest; + + /** + * Decodes a GetPatchJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPatchJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.GetPatchJobRequest; + + /** + * Verifies a GetPatchJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPatchJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPatchJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.GetPatchJobRequest; + + /** + * Creates a plain object from a GetPatchJobRequest message. Also converts values to other types if specified. + * @param message GetPatchJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.GetPatchJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPatchJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPatchJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPatchJobInstanceDetailsRequest. */ + interface IListPatchJobInstanceDetailsRequest { + + /** ListPatchJobInstanceDetailsRequest parent */ + parent?: (string|null); + + /** ListPatchJobInstanceDetailsRequest pageSize */ + pageSize?: (number|null); + + /** ListPatchJobInstanceDetailsRequest pageToken */ + pageToken?: (string|null); + + /** ListPatchJobInstanceDetailsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListPatchJobInstanceDetailsRequest. */ + class ListPatchJobInstanceDetailsRequest implements IListPatchJobInstanceDetailsRequest { + + /** + * Constructs a new ListPatchJobInstanceDetailsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest); + + /** ListPatchJobInstanceDetailsRequest parent. */ + public parent: string; + + /** ListPatchJobInstanceDetailsRequest pageSize. */ + public pageSize: number; + + /** ListPatchJobInstanceDetailsRequest pageToken. */ + public pageToken: string; + + /** ListPatchJobInstanceDetailsRequest filter. */ + public filter: string; + + /** + * Creates a new ListPatchJobInstanceDetailsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPatchJobInstanceDetailsRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest): google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest; + + /** + * Encodes the specified ListPatchJobInstanceDetailsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest.verify|verify} messages. + * @param message ListPatchJobInstanceDetailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPatchJobInstanceDetailsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest.verify|verify} messages. + * @param message ListPatchJobInstanceDetailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPatchJobInstanceDetailsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPatchJobInstanceDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest; + + /** + * Decodes a ListPatchJobInstanceDetailsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPatchJobInstanceDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest; + + /** + * Verifies a ListPatchJobInstanceDetailsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPatchJobInstanceDetailsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPatchJobInstanceDetailsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest; + + /** + * Creates a plain object from a ListPatchJobInstanceDetailsRequest message. Also converts values to other types if specified. + * @param message ListPatchJobInstanceDetailsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPatchJobInstanceDetailsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPatchJobInstanceDetailsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPatchJobInstanceDetailsResponse. */ + interface IListPatchJobInstanceDetailsResponse { + + /** ListPatchJobInstanceDetailsResponse patchJobInstanceDetails */ + patchJobInstanceDetails?: (google.cloud.osconfig.v1.IPatchJobInstanceDetails[]|null); + + /** ListPatchJobInstanceDetailsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPatchJobInstanceDetailsResponse. */ + class ListPatchJobInstanceDetailsResponse implements IListPatchJobInstanceDetailsResponse { + + /** + * Constructs a new ListPatchJobInstanceDetailsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse); + + /** ListPatchJobInstanceDetailsResponse patchJobInstanceDetails. */ + public patchJobInstanceDetails: google.cloud.osconfig.v1.IPatchJobInstanceDetails[]; + + /** ListPatchJobInstanceDetailsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPatchJobInstanceDetailsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPatchJobInstanceDetailsResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse): google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse; + + /** + * Encodes the specified ListPatchJobInstanceDetailsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse.verify|verify} messages. + * @param message ListPatchJobInstanceDetailsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPatchJobInstanceDetailsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse.verify|verify} messages. + * @param message ListPatchJobInstanceDetailsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPatchJobInstanceDetailsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPatchJobInstanceDetailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse; + + /** + * Decodes a ListPatchJobInstanceDetailsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPatchJobInstanceDetailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse; + + /** + * Verifies a ListPatchJobInstanceDetailsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPatchJobInstanceDetailsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPatchJobInstanceDetailsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse; + + /** + * Creates a plain object from a ListPatchJobInstanceDetailsResponse message. Also converts values to other types if specified. + * @param message ListPatchJobInstanceDetailsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPatchJobInstanceDetailsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPatchJobInstanceDetailsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PatchJobInstanceDetails. */ + interface IPatchJobInstanceDetails { + + /** PatchJobInstanceDetails name */ + name?: (string|null); + + /** PatchJobInstanceDetails instanceSystemId */ + instanceSystemId?: (string|null); + + /** PatchJobInstanceDetails state */ + state?: (google.cloud.osconfig.v1.Instance.PatchState|keyof typeof google.cloud.osconfig.v1.Instance.PatchState|null); + + /** PatchJobInstanceDetails failureReason */ + failureReason?: (string|null); + + /** PatchJobInstanceDetails attemptCount */ + attemptCount?: (number|Long|string|null); + } + + /** Represents a PatchJobInstanceDetails. */ + class PatchJobInstanceDetails implements IPatchJobInstanceDetails { + + /** + * Constructs a new PatchJobInstanceDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IPatchJobInstanceDetails); + + /** PatchJobInstanceDetails name. */ + public name: string; + + /** PatchJobInstanceDetails instanceSystemId. */ + public instanceSystemId: string; + + /** PatchJobInstanceDetails state. */ + public state: (google.cloud.osconfig.v1.Instance.PatchState|keyof typeof google.cloud.osconfig.v1.Instance.PatchState); + + /** PatchJobInstanceDetails failureReason. */ + public failureReason: string; + + /** PatchJobInstanceDetails attemptCount. */ + public attemptCount: (number|Long|string); + + /** + * Creates a new PatchJobInstanceDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchJobInstanceDetails instance + */ + public static create(properties?: google.cloud.osconfig.v1.IPatchJobInstanceDetails): google.cloud.osconfig.v1.PatchJobInstanceDetails; + + /** + * Encodes the specified PatchJobInstanceDetails message. Does not implicitly {@link google.cloud.osconfig.v1.PatchJobInstanceDetails.verify|verify} messages. + * @param message PatchJobInstanceDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IPatchJobInstanceDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchJobInstanceDetails message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchJobInstanceDetails.verify|verify} messages. + * @param message PatchJobInstanceDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IPatchJobInstanceDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchJobInstanceDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchJobInstanceDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.PatchJobInstanceDetails; + + /** + * Decodes a PatchJobInstanceDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchJobInstanceDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.PatchJobInstanceDetails; + + /** + * Verifies a PatchJobInstanceDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchJobInstanceDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchJobInstanceDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.PatchJobInstanceDetails; + + /** + * Creates a plain object from a PatchJobInstanceDetails message. Also converts values to other types if specified. + * @param message PatchJobInstanceDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.PatchJobInstanceDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchJobInstanceDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PatchJobInstanceDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPatchJobsRequest. */ + interface IListPatchJobsRequest { + + /** ListPatchJobsRequest parent */ + parent?: (string|null); + + /** ListPatchJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListPatchJobsRequest pageToken */ + pageToken?: (string|null); + + /** ListPatchJobsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListPatchJobsRequest. */ + class ListPatchJobsRequest implements IListPatchJobsRequest { + + /** + * Constructs a new ListPatchJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListPatchJobsRequest); + + /** ListPatchJobsRequest parent. */ + public parent: string; + + /** ListPatchJobsRequest pageSize. */ + public pageSize: number; + + /** ListPatchJobsRequest pageToken. */ + public pageToken: string; + + /** ListPatchJobsRequest filter. */ + public filter: string; + + /** + * Creates a new ListPatchJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPatchJobsRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListPatchJobsRequest): google.cloud.osconfig.v1.ListPatchJobsRequest; + + /** + * Encodes the specified ListPatchJobsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobsRequest.verify|verify} messages. + * @param message ListPatchJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListPatchJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPatchJobsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobsRequest.verify|verify} messages. + * @param message ListPatchJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListPatchJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPatchJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPatchJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListPatchJobsRequest; + + /** + * Decodes a ListPatchJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPatchJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListPatchJobsRequest; + + /** + * Verifies a ListPatchJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPatchJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPatchJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListPatchJobsRequest; + + /** + * Creates a plain object from a ListPatchJobsRequest message. Also converts values to other types if specified. + * @param message ListPatchJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListPatchJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPatchJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPatchJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPatchJobsResponse. */ + interface IListPatchJobsResponse { + + /** ListPatchJobsResponse patchJobs */ + patchJobs?: (google.cloud.osconfig.v1.IPatchJob[]|null); + + /** ListPatchJobsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPatchJobsResponse. */ + class ListPatchJobsResponse implements IListPatchJobsResponse { + + /** + * Constructs a new ListPatchJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListPatchJobsResponse); + + /** ListPatchJobsResponse patchJobs. */ + public patchJobs: google.cloud.osconfig.v1.IPatchJob[]; + + /** ListPatchJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPatchJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPatchJobsResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListPatchJobsResponse): google.cloud.osconfig.v1.ListPatchJobsResponse; + + /** + * Encodes the specified ListPatchJobsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobsResponse.verify|verify} messages. + * @param message ListPatchJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListPatchJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPatchJobsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobsResponse.verify|verify} messages. + * @param message ListPatchJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListPatchJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPatchJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPatchJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListPatchJobsResponse; + + /** + * Decodes a ListPatchJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPatchJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListPatchJobsResponse; + + /** + * Verifies a ListPatchJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPatchJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPatchJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListPatchJobsResponse; + + /** + * Creates a plain object from a ListPatchJobsResponse message. Also converts values to other types if specified. + * @param message ListPatchJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListPatchJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPatchJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPatchJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PatchJob. */ + interface IPatchJob { + + /** PatchJob name */ + name?: (string|null); + + /** PatchJob displayName */ + displayName?: (string|null); + + /** PatchJob description */ + description?: (string|null); + + /** PatchJob createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** PatchJob updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** PatchJob state */ + state?: (google.cloud.osconfig.v1.PatchJob.State|keyof typeof google.cloud.osconfig.v1.PatchJob.State|null); + + /** PatchJob instanceFilter */ + instanceFilter?: (google.cloud.osconfig.v1.IPatchInstanceFilter|null); + + /** PatchJob patchConfig */ + patchConfig?: (google.cloud.osconfig.v1.IPatchConfig|null); + + /** PatchJob duration */ + duration?: (google.protobuf.IDuration|null); + + /** PatchJob instanceDetailsSummary */ + instanceDetailsSummary?: (google.cloud.osconfig.v1.PatchJob.IInstanceDetailsSummary|null); + + /** PatchJob dryRun */ + dryRun?: (boolean|null); + + /** PatchJob errorMessage */ + errorMessage?: (string|null); + + /** PatchJob percentComplete */ + percentComplete?: (number|null); + + /** PatchJob patchDeployment */ + patchDeployment?: (string|null); + + /** PatchJob rollout */ + rollout?: (google.cloud.osconfig.v1.IPatchRollout|null); + } + + /** Represents a PatchJob. */ + class PatchJob implements IPatchJob { + + /** + * Constructs a new PatchJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IPatchJob); + + /** PatchJob name. */ + public name: string; + + /** PatchJob displayName. */ + public displayName: string; + + /** PatchJob description. */ + public description: string; + + /** PatchJob createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** PatchJob updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** PatchJob state. */ + public state: (google.cloud.osconfig.v1.PatchJob.State|keyof typeof google.cloud.osconfig.v1.PatchJob.State); + + /** PatchJob instanceFilter. */ + public instanceFilter?: (google.cloud.osconfig.v1.IPatchInstanceFilter|null); + + /** PatchJob patchConfig. */ + public patchConfig?: (google.cloud.osconfig.v1.IPatchConfig|null); + + /** PatchJob duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** PatchJob instanceDetailsSummary. */ + public instanceDetailsSummary?: (google.cloud.osconfig.v1.PatchJob.IInstanceDetailsSummary|null); + + /** PatchJob dryRun. */ + public dryRun: boolean; + + /** PatchJob errorMessage. */ + public errorMessage: string; + + /** PatchJob percentComplete. */ + public percentComplete: number; + + /** PatchJob patchDeployment. */ + public patchDeployment: string; + + /** PatchJob rollout. */ + public rollout?: (google.cloud.osconfig.v1.IPatchRollout|null); + + /** + * Creates a new PatchJob instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchJob instance + */ + public static create(properties?: google.cloud.osconfig.v1.IPatchJob): google.cloud.osconfig.v1.PatchJob; + + /** + * Encodes the specified PatchJob message. Does not implicitly {@link google.cloud.osconfig.v1.PatchJob.verify|verify} messages. + * @param message PatchJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IPatchJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchJob message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchJob.verify|verify} messages. + * @param message PatchJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IPatchJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.PatchJob; + + /** + * Decodes a PatchJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.PatchJob; + + /** + * Verifies a PatchJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.PatchJob; + + /** + * Creates a plain object from a PatchJob message. Also converts values to other types if specified. + * @param message PatchJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.PatchJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PatchJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PatchJob { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + STARTED = 1, + INSTANCE_LOOKUP = 2, + PATCHING = 3, + SUCCEEDED = 4, + COMPLETED_WITH_ERRORS = 5, + CANCELED = 6, + TIMED_OUT = 7 + } + + /** Properties of an InstanceDetailsSummary. */ + interface IInstanceDetailsSummary { + + /** InstanceDetailsSummary pendingInstanceCount */ + pendingInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary inactiveInstanceCount */ + inactiveInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary notifiedInstanceCount */ + notifiedInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary startedInstanceCount */ + startedInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary downloadingPatchesInstanceCount */ + downloadingPatchesInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary applyingPatchesInstanceCount */ + applyingPatchesInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary rebootingInstanceCount */ + rebootingInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary succeededInstanceCount */ + succeededInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary succeededRebootRequiredInstanceCount */ + succeededRebootRequiredInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary failedInstanceCount */ + failedInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary ackedInstanceCount */ + ackedInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary timedOutInstanceCount */ + timedOutInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary prePatchStepInstanceCount */ + prePatchStepInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary postPatchStepInstanceCount */ + postPatchStepInstanceCount?: (number|Long|string|null); + + /** InstanceDetailsSummary noAgentDetectedInstanceCount */ + noAgentDetectedInstanceCount?: (number|Long|string|null); + } + + /** Represents an InstanceDetailsSummary. */ + class InstanceDetailsSummary implements IInstanceDetailsSummary { + + /** + * Constructs a new InstanceDetailsSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.PatchJob.IInstanceDetailsSummary); + + /** InstanceDetailsSummary pendingInstanceCount. */ + public pendingInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary inactiveInstanceCount. */ + public inactiveInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary notifiedInstanceCount. */ + public notifiedInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary startedInstanceCount. */ + public startedInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary downloadingPatchesInstanceCount. */ + public downloadingPatchesInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary applyingPatchesInstanceCount. */ + public applyingPatchesInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary rebootingInstanceCount. */ + public rebootingInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary succeededInstanceCount. */ + public succeededInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary succeededRebootRequiredInstanceCount. */ + public succeededRebootRequiredInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary failedInstanceCount. */ + public failedInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary ackedInstanceCount. */ + public ackedInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary timedOutInstanceCount. */ + public timedOutInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary prePatchStepInstanceCount. */ + public prePatchStepInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary postPatchStepInstanceCount. */ + public postPatchStepInstanceCount: (number|Long|string); + + /** InstanceDetailsSummary noAgentDetectedInstanceCount. */ + public noAgentDetectedInstanceCount: (number|Long|string); + + /** + * Creates a new InstanceDetailsSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceDetailsSummary instance + */ + public static create(properties?: google.cloud.osconfig.v1.PatchJob.IInstanceDetailsSummary): google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary; + + /** + * Encodes the specified InstanceDetailsSummary message. Does not implicitly {@link google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary.verify|verify} messages. + * @param message InstanceDetailsSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.PatchJob.IInstanceDetailsSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceDetailsSummary message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary.verify|verify} messages. + * @param message InstanceDetailsSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.PatchJob.IInstanceDetailsSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceDetailsSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceDetailsSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary; + + /** + * Decodes an InstanceDetailsSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceDetailsSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary; + + /** + * Verifies an InstanceDetailsSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceDetailsSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceDetailsSummary + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary; + + /** + * Creates a plain object from an InstanceDetailsSummary message. Also converts values to other types if specified. + * @param message InstanceDetailsSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceDetailsSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceDetailsSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PatchConfig. */ + interface IPatchConfig { + + /** PatchConfig rebootConfig */ + rebootConfig?: (google.cloud.osconfig.v1.PatchConfig.RebootConfig|keyof typeof google.cloud.osconfig.v1.PatchConfig.RebootConfig|null); + + /** PatchConfig apt */ + apt?: (google.cloud.osconfig.v1.IAptSettings|null); + + /** PatchConfig yum */ + yum?: (google.cloud.osconfig.v1.IYumSettings|null); + + /** PatchConfig goo */ + goo?: (google.cloud.osconfig.v1.IGooSettings|null); + + /** PatchConfig zypper */ + zypper?: (google.cloud.osconfig.v1.IZypperSettings|null); + + /** PatchConfig windowsUpdate */ + windowsUpdate?: (google.cloud.osconfig.v1.IWindowsUpdateSettings|null); + + /** PatchConfig preStep */ + preStep?: (google.cloud.osconfig.v1.IExecStep|null); + + /** PatchConfig postStep */ + postStep?: (google.cloud.osconfig.v1.IExecStep|null); + + /** PatchConfig migInstancesAllowed */ + migInstancesAllowed?: (boolean|null); + } + + /** Represents a PatchConfig. */ + class PatchConfig implements IPatchConfig { + + /** + * Constructs a new PatchConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IPatchConfig); + + /** PatchConfig rebootConfig. */ + public rebootConfig: (google.cloud.osconfig.v1.PatchConfig.RebootConfig|keyof typeof google.cloud.osconfig.v1.PatchConfig.RebootConfig); + + /** PatchConfig apt. */ + public apt?: (google.cloud.osconfig.v1.IAptSettings|null); + + /** PatchConfig yum. */ + public yum?: (google.cloud.osconfig.v1.IYumSettings|null); + + /** PatchConfig goo. */ + public goo?: (google.cloud.osconfig.v1.IGooSettings|null); + + /** PatchConfig zypper. */ + public zypper?: (google.cloud.osconfig.v1.IZypperSettings|null); + + /** PatchConfig windowsUpdate. */ + public windowsUpdate?: (google.cloud.osconfig.v1.IWindowsUpdateSettings|null); + + /** PatchConfig preStep. */ + public preStep?: (google.cloud.osconfig.v1.IExecStep|null); + + /** PatchConfig postStep. */ + public postStep?: (google.cloud.osconfig.v1.IExecStep|null); + + /** PatchConfig migInstancesAllowed. */ + public migInstancesAllowed: boolean; + + /** + * Creates a new PatchConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchConfig instance + */ + public static create(properties?: google.cloud.osconfig.v1.IPatchConfig): google.cloud.osconfig.v1.PatchConfig; + + /** + * Encodes the specified PatchConfig message. Does not implicitly {@link google.cloud.osconfig.v1.PatchConfig.verify|verify} messages. + * @param message PatchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IPatchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchConfig message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchConfig.verify|verify} messages. + * @param message PatchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IPatchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.PatchConfig; + + /** + * Decodes a PatchConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.PatchConfig; + + /** + * Verifies a PatchConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.PatchConfig; + + /** + * Creates a plain object from a PatchConfig message. Also converts values to other types if specified. + * @param message PatchConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.PatchConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PatchConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PatchConfig { + + /** RebootConfig enum. */ + enum RebootConfig { + REBOOT_CONFIG_UNSPECIFIED = 0, + DEFAULT = 1, + ALWAYS = 2, + NEVER = 3 + } + } + + /** Properties of an Instance. */ + interface IInstance { + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IInstance); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.osconfig.v1.IInstance): google.cloud.osconfig.v1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.osconfig.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.Instance; + + /** + * Verifies an Instance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** PatchState enum. */ + enum PatchState { + PATCH_STATE_UNSPECIFIED = 0, + PENDING = 1, + INACTIVE = 2, + NOTIFIED = 3, + STARTED = 4, + DOWNLOADING_PATCHES = 5, + APPLYING_PATCHES = 6, + REBOOTING = 7, + SUCCEEDED = 8, + SUCCEEDED_REBOOT_REQUIRED = 9, + FAILED = 10, + ACKED = 11, + TIMED_OUT = 12, + RUNNING_PRE_PATCH_STEP = 13, + RUNNING_POST_PATCH_STEP = 14, + NO_AGENT_DETECTED = 15 + } + } + + /** Properties of a CancelPatchJobRequest. */ + interface ICancelPatchJobRequest { + + /** CancelPatchJobRequest name */ + name?: (string|null); + } + + /** Represents a CancelPatchJobRequest. */ + class CancelPatchJobRequest implements ICancelPatchJobRequest { + + /** + * Constructs a new CancelPatchJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.ICancelPatchJobRequest); + + /** CancelPatchJobRequest name. */ + public name: string; + + /** + * Creates a new CancelPatchJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelPatchJobRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.ICancelPatchJobRequest): google.cloud.osconfig.v1.CancelPatchJobRequest; + + /** + * Encodes the specified CancelPatchJobRequest message. Does not implicitly {@link google.cloud.osconfig.v1.CancelPatchJobRequest.verify|verify} messages. + * @param message CancelPatchJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.ICancelPatchJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelPatchJobRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.CancelPatchJobRequest.verify|verify} messages. + * @param message CancelPatchJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.ICancelPatchJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelPatchJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelPatchJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.CancelPatchJobRequest; + + /** + * Decodes a CancelPatchJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelPatchJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.CancelPatchJobRequest; + + /** + * Verifies a CancelPatchJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelPatchJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelPatchJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.CancelPatchJobRequest; + + /** + * Creates a plain object from a CancelPatchJobRequest message. Also converts values to other types if specified. + * @param message CancelPatchJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.CancelPatchJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelPatchJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelPatchJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AptSettings. */ + interface IAptSettings { + + /** AptSettings type */ + type?: (google.cloud.osconfig.v1.AptSettings.Type|keyof typeof google.cloud.osconfig.v1.AptSettings.Type|null); + + /** AptSettings excludes */ + excludes?: (string[]|null); + + /** AptSettings exclusivePackages */ + exclusivePackages?: (string[]|null); + } + + /** Represents an AptSettings. */ + class AptSettings implements IAptSettings { + + /** + * Constructs a new AptSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IAptSettings); + + /** AptSettings type. */ + public type: (google.cloud.osconfig.v1.AptSettings.Type|keyof typeof google.cloud.osconfig.v1.AptSettings.Type); + + /** AptSettings excludes. */ + public excludes: string[]; + + /** AptSettings exclusivePackages. */ + public exclusivePackages: string[]; + + /** + * Creates a new AptSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns AptSettings instance + */ + public static create(properties?: google.cloud.osconfig.v1.IAptSettings): google.cloud.osconfig.v1.AptSettings; + + /** + * Encodes the specified AptSettings message. Does not implicitly {@link google.cloud.osconfig.v1.AptSettings.verify|verify} messages. + * @param message AptSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IAptSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AptSettings message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.AptSettings.verify|verify} messages. + * @param message AptSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IAptSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AptSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AptSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.AptSettings; + + /** + * Decodes an AptSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AptSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.AptSettings; + + /** + * Verifies an AptSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AptSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AptSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.AptSettings; + + /** + * Creates a plain object from an AptSettings message. Also converts values to other types if specified. + * @param message AptSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.AptSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AptSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AptSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AptSettings { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + DIST = 1, + UPGRADE = 2 + } + } + + /** Properties of a YumSettings. */ + interface IYumSettings { + + /** YumSettings security */ + security?: (boolean|null); + + /** YumSettings minimal */ + minimal?: (boolean|null); + + /** YumSettings excludes */ + excludes?: (string[]|null); + + /** YumSettings exclusivePackages */ + exclusivePackages?: (string[]|null); + } + + /** Represents a YumSettings. */ + class YumSettings implements IYumSettings { + + /** + * Constructs a new YumSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IYumSettings); + + /** YumSettings security. */ + public security: boolean; + + /** YumSettings minimal. */ + public minimal: boolean; + + /** YumSettings excludes. */ + public excludes: string[]; + + /** YumSettings exclusivePackages. */ + public exclusivePackages: string[]; + + /** + * Creates a new YumSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns YumSettings instance + */ + public static create(properties?: google.cloud.osconfig.v1.IYumSettings): google.cloud.osconfig.v1.YumSettings; + + /** + * Encodes the specified YumSettings message. Does not implicitly {@link google.cloud.osconfig.v1.YumSettings.verify|verify} messages. + * @param message YumSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IYumSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified YumSettings message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.YumSettings.verify|verify} messages. + * @param message YumSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IYumSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a YumSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns YumSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.YumSettings; + + /** + * Decodes a YumSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns YumSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.YumSettings; + + /** + * Verifies a YumSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a YumSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns YumSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.YumSettings; + + /** + * Creates a plain object from a YumSettings message. Also converts values to other types if specified. + * @param message YumSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.YumSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this YumSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for YumSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GooSettings. */ + interface IGooSettings { + } + + /** Represents a GooSettings. */ + class GooSettings implements IGooSettings { + + /** + * Constructs a new GooSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IGooSettings); + + /** + * Creates a new GooSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GooSettings instance + */ + public static create(properties?: google.cloud.osconfig.v1.IGooSettings): google.cloud.osconfig.v1.GooSettings; + + /** + * Encodes the specified GooSettings message. Does not implicitly {@link google.cloud.osconfig.v1.GooSettings.verify|verify} messages. + * @param message GooSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IGooSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GooSettings message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GooSettings.verify|verify} messages. + * @param message GooSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IGooSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GooSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GooSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.GooSettings; + + /** + * Decodes a GooSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GooSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.GooSettings; + + /** + * Verifies a GooSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GooSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GooSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.GooSettings; + + /** + * Creates a plain object from a GooSettings message. Also converts values to other types if specified. + * @param message GooSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.GooSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GooSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GooSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ZypperSettings. */ + interface IZypperSettings { + + /** ZypperSettings withOptional */ + withOptional?: (boolean|null); + + /** ZypperSettings withUpdate */ + withUpdate?: (boolean|null); + + /** ZypperSettings categories */ + categories?: (string[]|null); + + /** ZypperSettings severities */ + severities?: (string[]|null); + + /** ZypperSettings excludes */ + excludes?: (string[]|null); + + /** ZypperSettings exclusivePatches */ + exclusivePatches?: (string[]|null); + } + + /** Represents a ZypperSettings. */ + class ZypperSettings implements IZypperSettings { + + /** + * Constructs a new ZypperSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IZypperSettings); + + /** ZypperSettings withOptional. */ + public withOptional: boolean; + + /** ZypperSettings withUpdate. */ + public withUpdate: boolean; + + /** ZypperSettings categories. */ + public categories: string[]; + + /** ZypperSettings severities. */ + public severities: string[]; + + /** ZypperSettings excludes. */ + public excludes: string[]; + + /** ZypperSettings exclusivePatches. */ + public exclusivePatches: string[]; + + /** + * Creates a new ZypperSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ZypperSettings instance + */ + public static create(properties?: google.cloud.osconfig.v1.IZypperSettings): google.cloud.osconfig.v1.ZypperSettings; + + /** + * Encodes the specified ZypperSettings message. Does not implicitly {@link google.cloud.osconfig.v1.ZypperSettings.verify|verify} messages. + * @param message ZypperSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IZypperSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZypperSettings message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ZypperSettings.verify|verify} messages. + * @param message ZypperSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IZypperSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZypperSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZypperSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ZypperSettings; + + /** + * Decodes a ZypperSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZypperSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ZypperSettings; + + /** + * Verifies a ZypperSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ZypperSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZypperSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ZypperSettings; + + /** + * Creates a plain object from a ZypperSettings message. Also converts values to other types if specified. + * @param message ZypperSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ZypperSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZypperSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ZypperSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WindowsUpdateSettings. */ + interface IWindowsUpdateSettings { + + /** WindowsUpdateSettings classifications */ + classifications?: (google.cloud.osconfig.v1.WindowsUpdateSettings.Classification[]|null); + + /** WindowsUpdateSettings excludes */ + excludes?: (string[]|null); + + /** WindowsUpdateSettings exclusivePatches */ + exclusivePatches?: (string[]|null); + } + + /** Represents a WindowsUpdateSettings. */ + class WindowsUpdateSettings implements IWindowsUpdateSettings { + + /** + * Constructs a new WindowsUpdateSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IWindowsUpdateSettings); + + /** WindowsUpdateSettings classifications. */ + public classifications: google.cloud.osconfig.v1.WindowsUpdateSettings.Classification[]; + + /** WindowsUpdateSettings excludes. */ + public excludes: string[]; + + /** WindowsUpdateSettings exclusivePatches. */ + public exclusivePatches: string[]; + + /** + * Creates a new WindowsUpdateSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsUpdateSettings instance + */ + public static create(properties?: google.cloud.osconfig.v1.IWindowsUpdateSettings): google.cloud.osconfig.v1.WindowsUpdateSettings; + + /** + * Encodes the specified WindowsUpdateSettings message. Does not implicitly {@link google.cloud.osconfig.v1.WindowsUpdateSettings.verify|verify} messages. + * @param message WindowsUpdateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IWindowsUpdateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsUpdateSettings message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.WindowsUpdateSettings.verify|verify} messages. + * @param message WindowsUpdateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IWindowsUpdateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsUpdateSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsUpdateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.WindowsUpdateSettings; + + /** + * Decodes a WindowsUpdateSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsUpdateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.WindowsUpdateSettings; + + /** + * Verifies a WindowsUpdateSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WindowsUpdateSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsUpdateSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.WindowsUpdateSettings; + + /** + * Creates a plain object from a WindowsUpdateSettings message. Also converts values to other types if specified. + * @param message WindowsUpdateSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.WindowsUpdateSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsUpdateSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsUpdateSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WindowsUpdateSettings { + + /** Classification enum. */ + enum Classification { + CLASSIFICATION_UNSPECIFIED = 0, + CRITICAL = 1, + SECURITY = 2, + DEFINITION = 3, + DRIVER = 4, + FEATURE_PACK = 5, + SERVICE_PACK = 6, + TOOL = 7, + UPDATE_ROLLUP = 8, + UPDATE = 9 + } + } + + /** Properties of an ExecStep. */ + interface IExecStep { + + /** ExecStep linuxExecStepConfig */ + linuxExecStepConfig?: (google.cloud.osconfig.v1.IExecStepConfig|null); + + /** ExecStep windowsExecStepConfig */ + windowsExecStepConfig?: (google.cloud.osconfig.v1.IExecStepConfig|null); + } + + /** Represents an ExecStep. */ + class ExecStep implements IExecStep { + + /** + * Constructs a new ExecStep. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IExecStep); + + /** ExecStep linuxExecStepConfig. */ + public linuxExecStepConfig?: (google.cloud.osconfig.v1.IExecStepConfig|null); + + /** ExecStep windowsExecStepConfig. */ + public windowsExecStepConfig?: (google.cloud.osconfig.v1.IExecStepConfig|null); + + /** + * Creates a new ExecStep instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecStep instance + */ + public static create(properties?: google.cloud.osconfig.v1.IExecStep): google.cloud.osconfig.v1.ExecStep; + + /** + * Encodes the specified ExecStep message. Does not implicitly {@link google.cloud.osconfig.v1.ExecStep.verify|verify} messages. + * @param message ExecStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IExecStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecStep message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ExecStep.verify|verify} messages. + * @param message ExecStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IExecStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecStep message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ExecStep; + + /** + * Decodes an ExecStep message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ExecStep; + + /** + * Verifies an ExecStep message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecStep message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecStep + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ExecStep; + + /** + * Creates a plain object from an ExecStep message. Also converts values to other types if specified. + * @param message ExecStep + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ExecStep, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecStep to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecStep + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecStepConfig. */ + interface IExecStepConfig { + + /** ExecStepConfig localPath */ + localPath?: (string|null); + + /** ExecStepConfig gcsObject */ + gcsObject?: (google.cloud.osconfig.v1.IGcsObject|null); + + /** ExecStepConfig allowedSuccessCodes */ + allowedSuccessCodes?: (number[]|null); + + /** ExecStepConfig interpreter */ + interpreter?: (google.cloud.osconfig.v1.ExecStepConfig.Interpreter|keyof typeof google.cloud.osconfig.v1.ExecStepConfig.Interpreter|null); + } + + /** Represents an ExecStepConfig. */ + class ExecStepConfig implements IExecStepConfig { + + /** + * Constructs a new ExecStepConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IExecStepConfig); + + /** ExecStepConfig localPath. */ + public localPath?: (string|null); + + /** ExecStepConfig gcsObject. */ + public gcsObject?: (google.cloud.osconfig.v1.IGcsObject|null); + + /** ExecStepConfig allowedSuccessCodes. */ + public allowedSuccessCodes: number[]; + + /** ExecStepConfig interpreter. */ + public interpreter: (google.cloud.osconfig.v1.ExecStepConfig.Interpreter|keyof typeof google.cloud.osconfig.v1.ExecStepConfig.Interpreter); + + /** ExecStepConfig executable. */ + public executable?: ("localPath"|"gcsObject"); + + /** + * Creates a new ExecStepConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecStepConfig instance + */ + public static create(properties?: google.cloud.osconfig.v1.IExecStepConfig): google.cloud.osconfig.v1.ExecStepConfig; + + /** + * Encodes the specified ExecStepConfig message. Does not implicitly {@link google.cloud.osconfig.v1.ExecStepConfig.verify|verify} messages. + * @param message ExecStepConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IExecStepConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecStepConfig message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ExecStepConfig.verify|verify} messages. + * @param message ExecStepConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IExecStepConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecStepConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecStepConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ExecStepConfig; + + /** + * Decodes an ExecStepConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecStepConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ExecStepConfig; + + /** + * Verifies an ExecStepConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecStepConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecStepConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ExecStepConfig; + + /** + * Creates a plain object from an ExecStepConfig message. Also converts values to other types if specified. + * @param message ExecStepConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ExecStepConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecStepConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecStepConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecStepConfig { + + /** Interpreter enum. */ + enum Interpreter { + INTERPRETER_UNSPECIFIED = 0, + SHELL = 1, + POWERSHELL = 2 + } + } + + /** Properties of a GcsObject. */ + interface IGcsObject { + + /** GcsObject bucket */ + bucket?: (string|null); + + /** GcsObject object */ + object?: (string|null); + + /** GcsObject generationNumber */ + generationNumber?: (number|Long|string|null); + } + + /** Represents a GcsObject. */ + class GcsObject implements IGcsObject { + + /** + * Constructs a new GcsObject. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IGcsObject); + + /** GcsObject bucket. */ + public bucket: string; + + /** GcsObject object. */ + public object: string; + + /** GcsObject generationNumber. */ + public generationNumber: (number|Long|string); + + /** + * Creates a new GcsObject instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsObject instance + */ + public static create(properties?: google.cloud.osconfig.v1.IGcsObject): google.cloud.osconfig.v1.GcsObject; + + /** + * Encodes the specified GcsObject message. Does not implicitly {@link google.cloud.osconfig.v1.GcsObject.verify|verify} messages. + * @param message GcsObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IGcsObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsObject message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GcsObject.verify|verify} messages. + * @param message GcsObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IGcsObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsObject message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.GcsObject; + + /** + * Decodes a GcsObject message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.GcsObject; + + /** + * Verifies a GcsObject message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsObject message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsObject + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.GcsObject; + + /** + * Creates a plain object from a GcsObject message. Also converts values to other types if specified. + * @param message GcsObject + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.GcsObject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsObject to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsObject + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PatchInstanceFilter. */ + interface IPatchInstanceFilter { + + /** PatchInstanceFilter all */ + all?: (boolean|null); + + /** PatchInstanceFilter groupLabels */ + groupLabels?: (google.cloud.osconfig.v1.PatchInstanceFilter.IGroupLabel[]|null); + + /** PatchInstanceFilter zones */ + zones?: (string[]|null); + + /** PatchInstanceFilter instances */ + instances?: (string[]|null); + + /** PatchInstanceFilter instanceNamePrefixes */ + instanceNamePrefixes?: (string[]|null); + } + + /** Represents a PatchInstanceFilter. */ + class PatchInstanceFilter implements IPatchInstanceFilter { + + /** + * Constructs a new PatchInstanceFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IPatchInstanceFilter); + + /** PatchInstanceFilter all. */ + public all: boolean; + + /** PatchInstanceFilter groupLabels. */ + public groupLabels: google.cloud.osconfig.v1.PatchInstanceFilter.IGroupLabel[]; + + /** PatchInstanceFilter zones. */ + public zones: string[]; + + /** PatchInstanceFilter instances. */ + public instances: string[]; + + /** PatchInstanceFilter instanceNamePrefixes. */ + public instanceNamePrefixes: string[]; + + /** + * Creates a new PatchInstanceFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchInstanceFilter instance + */ + public static create(properties?: google.cloud.osconfig.v1.IPatchInstanceFilter): google.cloud.osconfig.v1.PatchInstanceFilter; + + /** + * Encodes the specified PatchInstanceFilter message. Does not implicitly {@link google.cloud.osconfig.v1.PatchInstanceFilter.verify|verify} messages. + * @param message PatchInstanceFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IPatchInstanceFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchInstanceFilter message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchInstanceFilter.verify|verify} messages. + * @param message PatchInstanceFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IPatchInstanceFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchInstanceFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchInstanceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.PatchInstanceFilter; + + /** + * Decodes a PatchInstanceFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchInstanceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.PatchInstanceFilter; + + /** + * Verifies a PatchInstanceFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchInstanceFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchInstanceFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.PatchInstanceFilter; + + /** + * Creates a plain object from a PatchInstanceFilter message. Also converts values to other types if specified. + * @param message PatchInstanceFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.PatchInstanceFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchInstanceFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PatchInstanceFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PatchInstanceFilter { + + /** Properties of a GroupLabel. */ + interface IGroupLabel { + + /** GroupLabel labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a GroupLabel. */ + class GroupLabel implements IGroupLabel { + + /** + * Constructs a new GroupLabel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.PatchInstanceFilter.IGroupLabel); + + /** GroupLabel labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new GroupLabel instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupLabel instance + */ + public static create(properties?: google.cloud.osconfig.v1.PatchInstanceFilter.IGroupLabel): google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel; + + /** + * Encodes the specified GroupLabel message. Does not implicitly {@link google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel.verify|verify} messages. + * @param message GroupLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.PatchInstanceFilter.IGroupLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupLabel message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel.verify|verify} messages. + * @param message GroupLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.PatchInstanceFilter.IGroupLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupLabel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel; + + /** + * Decodes a GroupLabel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel; + + /** + * Verifies a GroupLabel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupLabel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupLabel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel; + + /** + * Creates a plain object from a GroupLabel message. Also converts values to other types if specified. + * @param message GroupLabel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupLabel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupLabel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PatchRollout. */ + interface IPatchRollout { + + /** PatchRollout mode */ + mode?: (google.cloud.osconfig.v1.PatchRollout.Mode|keyof typeof google.cloud.osconfig.v1.PatchRollout.Mode|null); + + /** PatchRollout disruptionBudget */ + disruptionBudget?: (google.cloud.osconfig.v1.IFixedOrPercent|null); + } + + /** Represents a PatchRollout. */ + class PatchRollout implements IPatchRollout { + + /** + * Constructs a new PatchRollout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IPatchRollout); + + /** PatchRollout mode. */ + public mode: (google.cloud.osconfig.v1.PatchRollout.Mode|keyof typeof google.cloud.osconfig.v1.PatchRollout.Mode); + + /** PatchRollout disruptionBudget. */ + public disruptionBudget?: (google.cloud.osconfig.v1.IFixedOrPercent|null); + + /** + * Creates a new PatchRollout instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchRollout instance + */ + public static create(properties?: google.cloud.osconfig.v1.IPatchRollout): google.cloud.osconfig.v1.PatchRollout; + + /** + * Encodes the specified PatchRollout message. Does not implicitly {@link google.cloud.osconfig.v1.PatchRollout.verify|verify} messages. + * @param message PatchRollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IPatchRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchRollout message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchRollout.verify|verify} messages. + * @param message PatchRollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IPatchRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchRollout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchRollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.PatchRollout; + + /** + * Decodes a PatchRollout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchRollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.PatchRollout; + + /** + * Verifies a PatchRollout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchRollout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchRollout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.PatchRollout; + + /** + * Creates a plain object from a PatchRollout message. Also converts values to other types if specified. + * @param message PatchRollout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.PatchRollout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchRollout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PatchRollout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PatchRollout { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + ZONE_BY_ZONE = 1, + CONCURRENT_ZONES = 2 + } + } + + /** Represents an OsConfigZonalService */ + class OsConfigZonalService extends $protobuf.rpc.Service { + + /** + * Constructs a new OsConfigZonalService 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 OsConfigZonalService 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): OsConfigZonalService; + + /** + * Calls CreateOSPolicyAssignment. + * @param request CreateOSPolicyAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createOSPolicyAssignment(request: google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest, callback: google.cloud.osconfig.v1.OsConfigZonalService.CreateOSPolicyAssignmentCallback): void; + + /** + * Calls CreateOSPolicyAssignment. + * @param request CreateOSPolicyAssignmentRequest message or plain object + * @returns Promise + */ + public createOSPolicyAssignment(request: google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest): Promise; + + /** + * Calls UpdateOSPolicyAssignment. + * @param request UpdateOSPolicyAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateOSPolicyAssignment(request: google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest, callback: google.cloud.osconfig.v1.OsConfigZonalService.UpdateOSPolicyAssignmentCallback): void; + + /** + * Calls UpdateOSPolicyAssignment. + * @param request UpdateOSPolicyAssignmentRequest message or plain object + * @returns Promise + */ + public updateOSPolicyAssignment(request: google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest): Promise; + + /** + * Calls GetOSPolicyAssignment. + * @param request GetOSPolicyAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OSPolicyAssignment + */ + public getOSPolicyAssignment(request: google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest, callback: google.cloud.osconfig.v1.OsConfigZonalService.GetOSPolicyAssignmentCallback): void; + + /** + * Calls GetOSPolicyAssignment. + * @param request GetOSPolicyAssignmentRequest message or plain object + * @returns Promise + */ + public getOSPolicyAssignment(request: google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest): Promise; + + /** + * Calls ListOSPolicyAssignments. + * @param request ListOSPolicyAssignmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOSPolicyAssignmentsResponse + */ + public listOSPolicyAssignments(request: google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest, callback: google.cloud.osconfig.v1.OsConfigZonalService.ListOSPolicyAssignmentsCallback): void; + + /** + * Calls ListOSPolicyAssignments. + * @param request ListOSPolicyAssignmentsRequest message or plain object + * @returns Promise + */ + public listOSPolicyAssignments(request: google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest): Promise; + + /** + * Calls ListOSPolicyAssignmentRevisions. + * @param request ListOSPolicyAssignmentRevisionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOSPolicyAssignmentRevisionsResponse + */ + public listOSPolicyAssignmentRevisions(request: google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest, callback: google.cloud.osconfig.v1.OsConfigZonalService.ListOSPolicyAssignmentRevisionsCallback): void; + + /** + * Calls ListOSPolicyAssignmentRevisions. + * @param request ListOSPolicyAssignmentRevisionsRequest message or plain object + * @returns Promise + */ + public listOSPolicyAssignmentRevisions(request: google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest): Promise; + + /** + * Calls DeleteOSPolicyAssignment. + * @param request DeleteOSPolicyAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteOSPolicyAssignment(request: google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest, callback: google.cloud.osconfig.v1.OsConfigZonalService.DeleteOSPolicyAssignmentCallback): void; + + /** + * Calls DeleteOSPolicyAssignment. + * @param request DeleteOSPolicyAssignmentRequest message or plain object + * @returns Promise + */ + public deleteOSPolicyAssignment(request: google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest): Promise; + + /** + * Calls GetOSPolicyAssignmentReport. + * @param request GetOSPolicyAssignmentReportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OSPolicyAssignmentReport + */ + public getOSPolicyAssignmentReport(request: google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest, callback: google.cloud.osconfig.v1.OsConfigZonalService.GetOSPolicyAssignmentReportCallback): void; + + /** + * Calls GetOSPolicyAssignmentReport. + * @param request GetOSPolicyAssignmentReportRequest message or plain object + * @returns Promise + */ + public getOSPolicyAssignmentReport(request: google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest): Promise; + + /** + * Calls ListOSPolicyAssignmentReports. + * @param request ListOSPolicyAssignmentReportsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOSPolicyAssignmentReportsResponse + */ + public listOSPolicyAssignmentReports(request: google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest, callback: google.cloud.osconfig.v1.OsConfigZonalService.ListOSPolicyAssignmentReportsCallback): void; + + /** + * Calls ListOSPolicyAssignmentReports. + * @param request ListOSPolicyAssignmentReportsRequest message or plain object + * @returns Promise + */ + public listOSPolicyAssignmentReports(request: google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest): Promise; + + /** + * Calls GetInventory. + * @param request GetInventoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Inventory + */ + public getInventory(request: google.cloud.osconfig.v1.IGetInventoryRequest, callback: google.cloud.osconfig.v1.OsConfigZonalService.GetInventoryCallback): void; + + /** + * Calls GetInventory. + * @param request GetInventoryRequest message or plain object + * @returns Promise + */ + public getInventory(request: google.cloud.osconfig.v1.IGetInventoryRequest): Promise; + + /** + * Calls ListInventories. + * @param request ListInventoriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInventoriesResponse + */ + public listInventories(request: google.cloud.osconfig.v1.IListInventoriesRequest, callback: google.cloud.osconfig.v1.OsConfigZonalService.ListInventoriesCallback): void; + + /** + * Calls ListInventories. + * @param request ListInventoriesRequest message or plain object + * @returns Promise + */ + public listInventories(request: google.cloud.osconfig.v1.IListInventoriesRequest): Promise; + + /** + * Calls GetVulnerabilityReport. + * @param request GetVulnerabilityReportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VulnerabilityReport + */ + public getVulnerabilityReport(request: google.cloud.osconfig.v1.IGetVulnerabilityReportRequest, callback: google.cloud.osconfig.v1.OsConfigZonalService.GetVulnerabilityReportCallback): void; + + /** + * Calls GetVulnerabilityReport. + * @param request GetVulnerabilityReportRequest message or plain object + * @returns Promise + */ + public getVulnerabilityReport(request: google.cloud.osconfig.v1.IGetVulnerabilityReportRequest): Promise; + + /** + * Calls ListVulnerabilityReports. + * @param request ListVulnerabilityReportsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListVulnerabilityReportsResponse + */ + public listVulnerabilityReports(request: google.cloud.osconfig.v1.IListVulnerabilityReportsRequest, callback: google.cloud.osconfig.v1.OsConfigZonalService.ListVulnerabilityReportsCallback): void; + + /** + * Calls ListVulnerabilityReports. + * @param request ListVulnerabilityReportsRequest message or plain object + * @returns Promise + */ + public listVulnerabilityReports(request: google.cloud.osconfig.v1.IListVulnerabilityReportsRequest): Promise; + } + + namespace OsConfigZonalService { + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|createOSPolicyAssignment}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateOSPolicyAssignmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|updateOSPolicyAssignment}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateOSPolicyAssignmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|getOSPolicyAssignment}. + * @param error Error, if any + * @param [response] OSPolicyAssignment + */ + type GetOSPolicyAssignmentCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.OSPolicyAssignment) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|listOSPolicyAssignments}. + * @param error Error, if any + * @param [response] ListOSPolicyAssignmentsResponse + */ + type ListOSPolicyAssignmentsCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|listOSPolicyAssignmentRevisions}. + * @param error Error, if any + * @param [response] ListOSPolicyAssignmentRevisionsResponse + */ + type ListOSPolicyAssignmentRevisionsCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|deleteOSPolicyAssignment}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteOSPolicyAssignmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|getOSPolicyAssignmentReport}. + * @param error Error, if any + * @param [response] OSPolicyAssignmentReport + */ + type GetOSPolicyAssignmentReportCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.OSPolicyAssignmentReport) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|listOSPolicyAssignmentReports}. + * @param error Error, if any + * @param [response] ListOSPolicyAssignmentReportsResponse + */ + type ListOSPolicyAssignmentReportsCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|getInventory}. + * @param error Error, if any + * @param [response] Inventory + */ + type GetInventoryCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.Inventory) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|listInventories}. + * @param error Error, if any + * @param [response] ListInventoriesResponse + */ + type ListInventoriesCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.ListInventoriesResponse) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|getVulnerabilityReport}. + * @param error Error, if any + * @param [response] VulnerabilityReport + */ + type GetVulnerabilityReportCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.VulnerabilityReport) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|listVulnerabilityReports}. + * @param error Error, if any + * @param [response] ListVulnerabilityReportsResponse + */ + type ListVulnerabilityReportsCallback = (error: (Error|null), response?: google.cloud.osconfig.v1.ListVulnerabilityReportsResponse) => void; + } + + /** Properties of a VulnerabilityReport. */ + interface IVulnerabilityReport { + + /** VulnerabilityReport name */ + name?: (string|null); + + /** VulnerabilityReport vulnerabilities */ + vulnerabilities?: (google.cloud.osconfig.v1.VulnerabilityReport.IVulnerability[]|null); + + /** VulnerabilityReport updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a VulnerabilityReport. */ + class VulnerabilityReport implements IVulnerabilityReport { + + /** + * Constructs a new VulnerabilityReport. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IVulnerabilityReport); + + /** VulnerabilityReport name. */ + public name: string; + + /** VulnerabilityReport vulnerabilities. */ + public vulnerabilities: google.cloud.osconfig.v1.VulnerabilityReport.IVulnerability[]; + + /** VulnerabilityReport updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new VulnerabilityReport instance using the specified properties. + * @param [properties] Properties to set + * @returns VulnerabilityReport instance + */ + public static create(properties?: google.cloud.osconfig.v1.IVulnerabilityReport): google.cloud.osconfig.v1.VulnerabilityReport; + + /** + * Encodes the specified VulnerabilityReport message. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.verify|verify} messages. + * @param message VulnerabilityReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IVulnerabilityReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VulnerabilityReport message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.verify|verify} messages. + * @param message VulnerabilityReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IVulnerabilityReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VulnerabilityReport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VulnerabilityReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.VulnerabilityReport; + + /** + * Decodes a VulnerabilityReport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VulnerabilityReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.VulnerabilityReport; + + /** + * Verifies a VulnerabilityReport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VulnerabilityReport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VulnerabilityReport + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.VulnerabilityReport; + + /** + * Creates a plain object from a VulnerabilityReport message. Also converts values to other types if specified. + * @param message VulnerabilityReport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.VulnerabilityReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VulnerabilityReport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VulnerabilityReport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VulnerabilityReport { + + /** Properties of a Vulnerability. */ + interface IVulnerability { + + /** Vulnerability details */ + details?: (google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IDetails|null); + + /** Vulnerability installedInventoryItemIds */ + installedInventoryItemIds?: (string[]|null); + + /** Vulnerability availableInventoryItemIds */ + availableInventoryItemIds?: (string[]|null); + + /** Vulnerability createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Vulnerability updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Vulnerability items */ + items?: (google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IItem[]|null); + } + + /** Represents a Vulnerability. */ + class Vulnerability implements IVulnerability { + + /** + * Constructs a new Vulnerability. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.VulnerabilityReport.IVulnerability); + + /** Vulnerability details. */ + public details?: (google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IDetails|null); + + /** Vulnerability installedInventoryItemIds. */ + public installedInventoryItemIds: string[]; + + /** Vulnerability availableInventoryItemIds. */ + public availableInventoryItemIds: string[]; + + /** Vulnerability createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Vulnerability updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Vulnerability items. */ + public items: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IItem[]; + + /** + * Creates a new Vulnerability instance using the specified properties. + * @param [properties] Properties to set + * @returns Vulnerability instance + */ + public static create(properties?: google.cloud.osconfig.v1.VulnerabilityReport.IVulnerability): google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability; + + /** + * Encodes the specified Vulnerability message. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.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.osconfig.v1.VulnerabilityReport.IVulnerability, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vulnerability message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.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.osconfig.v1.VulnerabilityReport.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.osconfig.v1.VulnerabilityReport.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.osconfig.v1.VulnerabilityReport.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.osconfig.v1.VulnerabilityReport.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.osconfig.v1.VulnerabilityReport.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; + } + + namespace Vulnerability { + + /** Properties of a Details. */ + interface IDetails { + + /** Details cve */ + cve?: (string|null); + + /** Details cvssV2Score */ + cvssV2Score?: (number|null); + + /** Details cvssV3 */ + cvssV3?: (google.cloud.osconfig.v1.ICVSSv3|null); + + /** Details severity */ + severity?: (string|null); + + /** Details description */ + description?: (string|null); + + /** Details references */ + references?: (google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.IReference[]|null); + } + + /** Represents a Details. */ + class Details implements IDetails { + + /** + * Constructs a new Details. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IDetails); + + /** Details cve. */ + public cve: string; + + /** Details cvssV2Score. */ + public cvssV2Score: number; + + /** Details cvssV3. */ + public cvssV3?: (google.cloud.osconfig.v1.ICVSSv3|null); + + /** Details severity. */ + public severity: string; + + /** Details description. */ + public description: string; + + /** Details references. */ + public references: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.IReference[]; + + /** + * Creates a new Details instance using the specified properties. + * @param [properties] Properties to set + * @returns Details instance + */ + public static create(properties?: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IDetails): google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details; + + /** + * Encodes the specified Details message. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.verify|verify} messages. + * @param message Details message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Details message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.verify|verify} messages. + * @param message Details message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Details message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details; + + /** + * Decodes a Details message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details; + + /** + * Verifies a Details message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Details message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Details + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details; + + /** + * Creates a plain object from a Details message. Also converts values to other types if specified. + * @param message Details + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Details to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Details + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Details { + + /** Properties of a Reference. */ + interface IReference { + + /** Reference url */ + url?: (string|null); + + /** Reference source */ + source?: (string|null); + } + + /** Represents a Reference. */ + class Reference implements IReference { + + /** + * Constructs a new Reference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.IReference); + + /** Reference url. */ + public url: string; + + /** Reference source. */ + public source: string; + + /** + * Creates a new Reference instance using the specified properties. + * @param [properties] Properties to set + * @returns Reference instance + */ + public static create(properties?: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.IReference): google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference; + + /** + * Encodes the specified Reference message. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.IReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Reference message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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 an Item. */ + interface IItem { + + /** Item installedInventoryItemId */ + installedInventoryItemId?: (string|null); + + /** Item availableInventoryItemId */ + availableInventoryItemId?: (string|null); + + /** Item fixedCpeUri */ + fixedCpeUri?: (string|null); + + /** Item upstreamFix */ + upstreamFix?: (string|null); + } + + /** Represents an Item. */ + class Item implements IItem { + + /** + * Constructs a new Item. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IItem); + + /** Item installedInventoryItemId. */ + public installedInventoryItemId: string; + + /** Item availableInventoryItemId. */ + public availableInventoryItemId: string; + + /** Item fixedCpeUri. */ + public fixedCpeUri: string; + + /** Item upstreamFix. */ + public upstreamFix: string; + + /** + * Creates a new Item instance using the specified properties. + * @param [properties] Properties to set + * @returns Item instance + */ + public static create(properties?: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IItem): google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Item message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item; + + /** + * Verifies an Item message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Item + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @param message Item + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Item to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Item + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a GetVulnerabilityReportRequest. */ + interface IGetVulnerabilityReportRequest { + + /** GetVulnerabilityReportRequest name */ + name?: (string|null); + } + + /** Represents a GetVulnerabilityReportRequest. */ + class GetVulnerabilityReportRequest implements IGetVulnerabilityReportRequest { + + /** + * Constructs a new GetVulnerabilityReportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IGetVulnerabilityReportRequest); + + /** GetVulnerabilityReportRequest name. */ + public name: string; + + /** + * Creates a new GetVulnerabilityReportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetVulnerabilityReportRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IGetVulnerabilityReportRequest): google.cloud.osconfig.v1.GetVulnerabilityReportRequest; + + /** + * Encodes the specified GetVulnerabilityReportRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetVulnerabilityReportRequest.verify|verify} messages. + * @param message GetVulnerabilityReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IGetVulnerabilityReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetVulnerabilityReportRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetVulnerabilityReportRequest.verify|verify} messages. + * @param message GetVulnerabilityReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IGetVulnerabilityReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetVulnerabilityReportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetVulnerabilityReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.GetVulnerabilityReportRequest; + + /** + * Decodes a GetVulnerabilityReportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetVulnerabilityReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.GetVulnerabilityReportRequest; + + /** + * Verifies a GetVulnerabilityReportRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetVulnerabilityReportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetVulnerabilityReportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.GetVulnerabilityReportRequest; + + /** + * Creates a plain object from a GetVulnerabilityReportRequest message. Also converts values to other types if specified. + * @param message GetVulnerabilityReportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.GetVulnerabilityReportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetVulnerabilityReportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetVulnerabilityReportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVulnerabilityReportsRequest. */ + interface IListVulnerabilityReportsRequest { + + /** ListVulnerabilityReportsRequest parent */ + parent?: (string|null); + + /** ListVulnerabilityReportsRequest pageSize */ + pageSize?: (number|null); + + /** ListVulnerabilityReportsRequest pageToken */ + pageToken?: (string|null); + + /** ListVulnerabilityReportsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListVulnerabilityReportsRequest. */ + class ListVulnerabilityReportsRequest implements IListVulnerabilityReportsRequest { + + /** + * Constructs a new ListVulnerabilityReportsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListVulnerabilityReportsRequest); + + /** ListVulnerabilityReportsRequest parent. */ + public parent: string; + + /** ListVulnerabilityReportsRequest pageSize. */ + public pageSize: number; + + /** ListVulnerabilityReportsRequest pageToken. */ + public pageToken: string; + + /** ListVulnerabilityReportsRequest filter. */ + public filter: string; + + /** + * Creates a new ListVulnerabilityReportsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVulnerabilityReportsRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListVulnerabilityReportsRequest): google.cloud.osconfig.v1.ListVulnerabilityReportsRequest; + + /** + * Encodes the specified ListVulnerabilityReportsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListVulnerabilityReportsRequest.verify|verify} messages. + * @param message ListVulnerabilityReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListVulnerabilityReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVulnerabilityReportsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListVulnerabilityReportsRequest.verify|verify} messages. + * @param message ListVulnerabilityReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListVulnerabilityReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVulnerabilityReportsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVulnerabilityReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListVulnerabilityReportsRequest; + + /** + * Decodes a ListVulnerabilityReportsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVulnerabilityReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListVulnerabilityReportsRequest; + + /** + * Verifies a ListVulnerabilityReportsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVulnerabilityReportsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVulnerabilityReportsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListVulnerabilityReportsRequest; + + /** + * Creates a plain object from a ListVulnerabilityReportsRequest message. Also converts values to other types if specified. + * @param message ListVulnerabilityReportsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListVulnerabilityReportsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVulnerabilityReportsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVulnerabilityReportsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVulnerabilityReportsResponse. */ + interface IListVulnerabilityReportsResponse { + + /** ListVulnerabilityReportsResponse vulnerabilityReports */ + vulnerabilityReports?: (google.cloud.osconfig.v1.IVulnerabilityReport[]|null); + + /** ListVulnerabilityReportsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListVulnerabilityReportsResponse. */ + class ListVulnerabilityReportsResponse implements IListVulnerabilityReportsResponse { + + /** + * Constructs a new ListVulnerabilityReportsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListVulnerabilityReportsResponse); + + /** ListVulnerabilityReportsResponse vulnerabilityReports. */ + public vulnerabilityReports: google.cloud.osconfig.v1.IVulnerabilityReport[]; + + /** ListVulnerabilityReportsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListVulnerabilityReportsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVulnerabilityReportsResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListVulnerabilityReportsResponse): google.cloud.osconfig.v1.ListVulnerabilityReportsResponse; + + /** + * Encodes the specified ListVulnerabilityReportsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.verify|verify} messages. + * @param message ListVulnerabilityReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListVulnerabilityReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVulnerabilityReportsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.verify|verify} messages. + * @param message ListVulnerabilityReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListVulnerabilityReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVulnerabilityReportsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVulnerabilityReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1.ListVulnerabilityReportsResponse; + + /** + * Decodes a ListVulnerabilityReportsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVulnerabilityReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1.ListVulnerabilityReportsResponse; + + /** + * Verifies a ListVulnerabilityReportsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVulnerabilityReportsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVulnerabilityReportsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListVulnerabilityReportsResponse; + + /** + * Creates a plain object from a ListVulnerabilityReportsResponse message. Also converts values to other types if specified. + * @param message ListVulnerabilityReportsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListVulnerabilityReportsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVulnerabilityReportsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVulnerabilityReportsResponse + * @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 exploitabilityScore */ + exploitabilityScore?: (number|null); + + /** CVSSv3 impactScore */ + impactScore?: (number|null); + + /** CVSSv3 attackVector */ + attackVector?: (google.cloud.osconfig.v1.CVSSv3.AttackVector|keyof typeof google.cloud.osconfig.v1.CVSSv3.AttackVector|null); + + /** CVSSv3 attackComplexity */ + attackComplexity?: (google.cloud.osconfig.v1.CVSSv3.AttackComplexity|keyof typeof google.cloud.osconfig.v1.CVSSv3.AttackComplexity|null); + + /** CVSSv3 privilegesRequired */ + privilegesRequired?: (google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired|keyof typeof google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired|null); + + /** CVSSv3 userInteraction */ + userInteraction?: (google.cloud.osconfig.v1.CVSSv3.UserInteraction|keyof typeof google.cloud.osconfig.v1.CVSSv3.UserInteraction|null); + + /** CVSSv3 scope */ + scope?: (google.cloud.osconfig.v1.CVSSv3.Scope|keyof typeof google.cloud.osconfig.v1.CVSSv3.Scope|null); + + /** CVSSv3 confidentialityImpact */ + confidentialityImpact?: (google.cloud.osconfig.v1.CVSSv3.Impact|keyof typeof google.cloud.osconfig.v1.CVSSv3.Impact|null); + + /** CVSSv3 integrityImpact */ + integrityImpact?: (google.cloud.osconfig.v1.CVSSv3.Impact|keyof typeof google.cloud.osconfig.v1.CVSSv3.Impact|null); + + /** CVSSv3 availabilityImpact */ + availabilityImpact?: (google.cloud.osconfig.v1.CVSSv3.Impact|keyof typeof google.cloud.osconfig.v1.CVSSv3.Impact|null); + } + + /** Represents a CVSSv3. */ + class CVSSv3 implements ICVSSv3 { + + /** + * Constructs a new CVSSv3. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.ICVSSv3); + + /** CVSSv3 baseScore. */ + public baseScore: number; + + /** CVSSv3 exploitabilityScore. */ + public exploitabilityScore: number; + + /** CVSSv3 impactScore. */ + public impactScore: number; + + /** CVSSv3 attackVector. */ + public attackVector: (google.cloud.osconfig.v1.CVSSv3.AttackVector|keyof typeof google.cloud.osconfig.v1.CVSSv3.AttackVector); + + /** CVSSv3 attackComplexity. */ + public attackComplexity: (google.cloud.osconfig.v1.CVSSv3.AttackComplexity|keyof typeof google.cloud.osconfig.v1.CVSSv3.AttackComplexity); + + /** CVSSv3 privilegesRequired. */ + public privilegesRequired: (google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired|keyof typeof google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired); + + /** CVSSv3 userInteraction. */ + public userInteraction: (google.cloud.osconfig.v1.CVSSv3.UserInteraction|keyof typeof google.cloud.osconfig.v1.CVSSv3.UserInteraction); + + /** CVSSv3 scope. */ + public scope: (google.cloud.osconfig.v1.CVSSv3.Scope|keyof typeof google.cloud.osconfig.v1.CVSSv3.Scope); + + /** CVSSv3 confidentialityImpact. */ + public confidentialityImpact: (google.cloud.osconfig.v1.CVSSv3.Impact|keyof typeof google.cloud.osconfig.v1.CVSSv3.Impact); + + /** CVSSv3 integrityImpact. */ + public integrityImpact: (google.cloud.osconfig.v1.CVSSv3.Impact|keyof typeof google.cloud.osconfig.v1.CVSSv3.Impact); + + /** CVSSv3 availabilityImpact. */ + public availabilityImpact: (google.cloud.osconfig.v1.CVSSv3.Impact|keyof typeof google.cloud.osconfig.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.osconfig.v1.ICVSSv3): google.cloud.osconfig.v1.CVSSv3; + + /** + * Encodes the specified CVSSv3 message. Does not implicitly {@link google.cloud.osconfig.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.osconfig.v1.ICVSSv3, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CVSSv3 message, length delimited. Does not implicitly {@link google.cloud.osconfig.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.osconfig.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.osconfig.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.osconfig.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.osconfig.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.osconfig.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 + } + } + } + + /** Namespace v1alpha. */ + namespace v1alpha { + + /** Properties of a OSPolicyResourceConfigStep. */ + interface IOSPolicyResourceConfigStep { + + /** OSPolicyResourceConfigStep type */ + type?: (google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Type|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Type|null); + + /** OSPolicyResourceConfigStep outcome */ + outcome?: (google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Outcome|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Outcome|null); + + /** OSPolicyResourceConfigStep errorMessage */ + errorMessage?: (string|null); + } + + /** Represents a OSPolicyResourceConfigStep. */ + class OSPolicyResourceConfigStep implements IOSPolicyResourceConfigStep { + + /** + * Constructs a new OSPolicyResourceConfigStep. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IOSPolicyResourceConfigStep); + + /** OSPolicyResourceConfigStep type. */ + public type: (google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Type|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Type); + + /** OSPolicyResourceConfigStep outcome. */ + public outcome: (google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Outcome|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Outcome); + + /** OSPolicyResourceConfigStep errorMessage. */ + public errorMessage: string; + + /** + * Creates a new OSPolicyResourceConfigStep instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyResourceConfigStep instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IOSPolicyResourceConfigStep): google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep; + + /** + * Encodes the specified OSPolicyResourceConfigStep message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.verify|verify} messages. + * @param message OSPolicyResourceConfigStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IOSPolicyResourceConfigStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyResourceConfigStep message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.verify|verify} messages. + * @param message OSPolicyResourceConfigStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IOSPolicyResourceConfigStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyResourceConfigStep message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyResourceConfigStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep; + + /** + * Decodes a OSPolicyResourceConfigStep message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyResourceConfigStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep; + + /** + * Verifies a OSPolicyResourceConfigStep message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyResourceConfigStep message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyResourceConfigStep + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep; + + /** + * Creates a plain object from a OSPolicyResourceConfigStep message. Also converts values to other types if specified. + * @param message OSPolicyResourceConfigStep + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyResourceConfigStep to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyResourceConfigStep + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyResourceConfigStep { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + VALIDATION = 1, + DESIRED_STATE_CHECK = 2, + DESIRED_STATE_ENFORCEMENT = 3, + DESIRED_STATE_CHECK_POST_ENFORCEMENT = 4 + } + + /** Outcome enum. */ + enum Outcome { + OUTCOME_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2 + } + } + + /** Properties of a OSPolicyResourceCompliance. */ + interface IOSPolicyResourceCompliance { + + /** OSPolicyResourceCompliance osPolicyResourceId */ + osPolicyResourceId?: (string|null); + + /** OSPolicyResourceCompliance configSteps */ + configSteps?: (google.cloud.osconfig.v1alpha.IOSPolicyResourceConfigStep[]|null); + + /** OSPolicyResourceCompliance state */ + state?: (google.cloud.osconfig.v1alpha.OSPolicyComplianceState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyComplianceState|null); + + /** OSPolicyResourceCompliance execResourceOutput */ + execResourceOutput?: (google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.IExecResourceOutput|null); + } + + /** Represents a OSPolicyResourceCompliance. */ + class OSPolicyResourceCompliance implements IOSPolicyResourceCompliance { + + /** + * Constructs a new OSPolicyResourceCompliance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IOSPolicyResourceCompliance); + + /** OSPolicyResourceCompliance osPolicyResourceId. */ + public osPolicyResourceId: string; + + /** OSPolicyResourceCompliance configSteps. */ + public configSteps: google.cloud.osconfig.v1alpha.IOSPolicyResourceConfigStep[]; + + /** OSPolicyResourceCompliance state. */ + public state: (google.cloud.osconfig.v1alpha.OSPolicyComplianceState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyComplianceState); + + /** OSPolicyResourceCompliance execResourceOutput. */ + public execResourceOutput?: (google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.IExecResourceOutput|null); + + /** OSPolicyResourceCompliance output. */ + public output?: "execResourceOutput"; + + /** + * Creates a new OSPolicyResourceCompliance instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyResourceCompliance instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IOSPolicyResourceCompliance): google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance; + + /** + * Encodes the specified OSPolicyResourceCompliance message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.verify|verify} messages. + * @param message OSPolicyResourceCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IOSPolicyResourceCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyResourceCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.verify|verify} messages. + * @param message OSPolicyResourceCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IOSPolicyResourceCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyResourceCompliance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyResourceCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance; + + /** + * Decodes a OSPolicyResourceCompliance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyResourceCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance; + + /** + * Verifies a OSPolicyResourceCompliance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyResourceCompliance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyResourceCompliance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance; + + /** + * Creates a plain object from a OSPolicyResourceCompliance message. Also converts values to other types if specified. + * @param message OSPolicyResourceCompliance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyResourceCompliance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyResourceCompliance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyResourceCompliance { + + /** Properties of an ExecResourceOutput. */ + interface IExecResourceOutput { + + /** ExecResourceOutput enforcementOutput */ + enforcementOutput?: (Uint8Array|string|null); + } + + /** Represents an ExecResourceOutput. */ + class ExecResourceOutput implements IExecResourceOutput { + + /** + * Constructs a new ExecResourceOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.IExecResourceOutput); + + /** ExecResourceOutput enforcementOutput. */ + public enforcementOutput: (Uint8Array|string); + + /** + * Creates a new ExecResourceOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecResourceOutput instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.IExecResourceOutput): google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput; + + /** + * Encodes the specified ExecResourceOutput message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput.verify|verify} messages. + * @param message ExecResourceOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.IExecResourceOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecResourceOutput message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput.verify|verify} messages. + * @param message ExecResourceOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.IExecResourceOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecResourceOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecResourceOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput; + + /** + * Decodes an ExecResourceOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecResourceOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput; + + /** + * Verifies an ExecResourceOutput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecResourceOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecResourceOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput; + + /** + * Creates a plain object from an ExecResourceOutput message. Also converts values to other types if specified. + * @param message ExecResourceOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecResourceOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecResourceOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** OSPolicyComplianceState enum. */ + enum OSPolicyComplianceState { + OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED = 0, + COMPLIANT = 1, + NON_COMPLIANT = 2, + UNKNOWN = 3, + NO_OS_POLICIES_APPLICABLE = 4 + } + + /** Properties of an InstanceOSPoliciesCompliance. */ + interface IInstanceOSPoliciesCompliance { + + /** InstanceOSPoliciesCompliance name */ + name?: (string|null); + + /** InstanceOSPoliciesCompliance instance */ + instance?: (string|null); + + /** InstanceOSPoliciesCompliance state */ + state?: (google.cloud.osconfig.v1alpha.OSPolicyComplianceState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyComplianceState|null); + + /** InstanceOSPoliciesCompliance detailedState */ + detailedState?: (string|null); + + /** InstanceOSPoliciesCompliance detailedStateReason */ + detailedStateReason?: (string|null); + + /** InstanceOSPoliciesCompliance osPolicyCompliances */ + osPolicyCompliances?: (google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.IOSPolicyCompliance[]|null); + + /** InstanceOSPoliciesCompliance lastComplianceCheckTime */ + lastComplianceCheckTime?: (google.protobuf.ITimestamp|null); + + /** InstanceOSPoliciesCompliance lastComplianceRunId */ + lastComplianceRunId?: (string|null); + } + + /** Represents an InstanceOSPoliciesCompliance. */ + class InstanceOSPoliciesCompliance implements IInstanceOSPoliciesCompliance { + + /** + * Constructs a new InstanceOSPoliciesCompliance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance); + + /** InstanceOSPoliciesCompliance name. */ + public name: string; + + /** InstanceOSPoliciesCompliance instance. */ + public instance: string; + + /** InstanceOSPoliciesCompliance state. */ + public state: (google.cloud.osconfig.v1alpha.OSPolicyComplianceState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyComplianceState); + + /** InstanceOSPoliciesCompliance detailedState. */ + public detailedState: string; + + /** InstanceOSPoliciesCompliance detailedStateReason. */ + public detailedStateReason: string; + + /** InstanceOSPoliciesCompliance osPolicyCompliances. */ + public osPolicyCompliances: google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.IOSPolicyCompliance[]; + + /** InstanceOSPoliciesCompliance lastComplianceCheckTime. */ + public lastComplianceCheckTime?: (google.protobuf.ITimestamp|null); + + /** InstanceOSPoliciesCompliance lastComplianceRunId. */ + public lastComplianceRunId: string; + + /** + * Creates a new InstanceOSPoliciesCompliance instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceOSPoliciesCompliance instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance): google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance; + + /** + * Encodes the specified InstanceOSPoliciesCompliance message. Does not implicitly {@link google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.verify|verify} messages. + * @param message InstanceOSPoliciesCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceOSPoliciesCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.verify|verify} messages. + * @param message InstanceOSPoliciesCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceOSPoliciesCompliance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceOSPoliciesCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance; + + /** + * Decodes an InstanceOSPoliciesCompliance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceOSPoliciesCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance; + + /** + * Verifies an InstanceOSPoliciesCompliance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceOSPoliciesCompliance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceOSPoliciesCompliance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance; + + /** + * Creates a plain object from an InstanceOSPoliciesCompliance message. Also converts values to other types if specified. + * @param message InstanceOSPoliciesCompliance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceOSPoliciesCompliance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceOSPoliciesCompliance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstanceOSPoliciesCompliance { + + /** Properties of a OSPolicyCompliance. */ + interface IOSPolicyCompliance { + + /** OSPolicyCompliance osPolicyId */ + osPolicyId?: (string|null); + + /** OSPolicyCompliance osPolicyAssignment */ + osPolicyAssignment?: (string|null); + + /** OSPolicyCompliance state */ + state?: (google.cloud.osconfig.v1alpha.OSPolicyComplianceState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyComplianceState|null); + + /** OSPolicyCompliance osPolicyResourceCompliances */ + osPolicyResourceCompliances?: (google.cloud.osconfig.v1alpha.IOSPolicyResourceCompliance[]|null); + } + + /** Represents a OSPolicyCompliance. */ + class OSPolicyCompliance implements IOSPolicyCompliance { + + /** + * Constructs a new OSPolicyCompliance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.IOSPolicyCompliance); + + /** OSPolicyCompliance osPolicyId. */ + public osPolicyId: string; + + /** OSPolicyCompliance osPolicyAssignment. */ + public osPolicyAssignment: string; + + /** OSPolicyCompliance state. */ + public state: (google.cloud.osconfig.v1alpha.OSPolicyComplianceState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyComplianceState); + + /** OSPolicyCompliance osPolicyResourceCompliances. */ + public osPolicyResourceCompliances: google.cloud.osconfig.v1alpha.IOSPolicyResourceCompliance[]; + + /** + * Creates a new OSPolicyCompliance instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyCompliance instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.IOSPolicyCompliance): google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance; + + /** + * Encodes the specified OSPolicyCompliance message. Does not implicitly {@link google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance.verify|verify} messages. + * @param message OSPolicyCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.IOSPolicyCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance.verify|verify} messages. + * @param message OSPolicyCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.IOSPolicyCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyCompliance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance; + + /** + * Decodes a OSPolicyCompliance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance; + + /** + * Verifies a OSPolicyCompliance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyCompliance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyCompliance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance; + + /** + * Creates a plain object from a OSPolicyCompliance message. Also converts values to other types if specified. + * @param message OSPolicyCompliance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyCompliance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyCompliance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GetInstanceOSPoliciesComplianceRequest. */ + interface IGetInstanceOSPoliciesComplianceRequest { + + /** GetInstanceOSPoliciesComplianceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceOSPoliciesComplianceRequest. */ + class GetInstanceOSPoliciesComplianceRequest implements IGetInstanceOSPoliciesComplianceRequest { + + /** + * Constructs a new GetInstanceOSPoliciesComplianceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest); + + /** GetInstanceOSPoliciesComplianceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceOSPoliciesComplianceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceOSPoliciesComplianceRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest): google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest; + + /** + * Encodes the specified GetInstanceOSPoliciesComplianceRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest.verify|verify} messages. + * @param message GetInstanceOSPoliciesComplianceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceOSPoliciesComplianceRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest.verify|verify} messages. + * @param message GetInstanceOSPoliciesComplianceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceOSPoliciesComplianceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceOSPoliciesComplianceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest; + + /** + * Decodes a GetInstanceOSPoliciesComplianceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceOSPoliciesComplianceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest; + + /** + * Verifies a GetInstanceOSPoliciesComplianceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceOSPoliciesComplianceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceOSPoliciesComplianceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest; + + /** + * Creates a plain object from a GetInstanceOSPoliciesComplianceRequest message. Also converts values to other types if specified. + * @param message GetInstanceOSPoliciesComplianceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceOSPoliciesComplianceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceOSPoliciesComplianceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstanceOSPoliciesCompliancesRequest. */ + interface IListInstanceOSPoliciesCompliancesRequest { + + /** ListInstanceOSPoliciesCompliancesRequest parent */ + parent?: (string|null); + + /** ListInstanceOSPoliciesCompliancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstanceOSPoliciesCompliancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstanceOSPoliciesCompliancesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListInstanceOSPoliciesCompliancesRequest. */ + class ListInstanceOSPoliciesCompliancesRequest implements IListInstanceOSPoliciesCompliancesRequest { + + /** + * Constructs a new ListInstanceOSPoliciesCompliancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest); + + /** ListInstanceOSPoliciesCompliancesRequest parent. */ + public parent: string; + + /** ListInstanceOSPoliciesCompliancesRequest pageSize. */ + public pageSize: number; + + /** ListInstanceOSPoliciesCompliancesRequest pageToken. */ + public pageToken: string; + + /** ListInstanceOSPoliciesCompliancesRequest filter. */ + public filter: string; + + /** + * Creates a new ListInstanceOSPoliciesCompliancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstanceOSPoliciesCompliancesRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest): google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest; + + /** + * Encodes the specified ListInstanceOSPoliciesCompliancesRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest.verify|verify} messages. + * @param message ListInstanceOSPoliciesCompliancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstanceOSPoliciesCompliancesRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest.verify|verify} messages. + * @param message ListInstanceOSPoliciesCompliancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstanceOSPoliciesCompliancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstanceOSPoliciesCompliancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest; + + /** + * Decodes a ListInstanceOSPoliciesCompliancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstanceOSPoliciesCompliancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest; + + /** + * Verifies a ListInstanceOSPoliciesCompliancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstanceOSPoliciesCompliancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstanceOSPoliciesCompliancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest; + + /** + * Creates a plain object from a ListInstanceOSPoliciesCompliancesRequest message. Also converts values to other types if specified. + * @param message ListInstanceOSPoliciesCompliancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstanceOSPoliciesCompliancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstanceOSPoliciesCompliancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstanceOSPoliciesCompliancesResponse. */ + interface IListInstanceOSPoliciesCompliancesResponse { + + /** ListInstanceOSPoliciesCompliancesResponse instanceOsPoliciesCompliances */ + instanceOsPoliciesCompliances?: (google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance[]|null); + + /** ListInstanceOSPoliciesCompliancesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInstanceOSPoliciesCompliancesResponse. */ + class ListInstanceOSPoliciesCompliancesResponse implements IListInstanceOSPoliciesCompliancesResponse { + + /** + * Constructs a new ListInstanceOSPoliciesCompliancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse); + + /** ListInstanceOSPoliciesCompliancesResponse instanceOsPoliciesCompliances. */ + public instanceOsPoliciesCompliances: google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance[]; + + /** ListInstanceOSPoliciesCompliancesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInstanceOSPoliciesCompliancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstanceOSPoliciesCompliancesResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse): google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse; + + /** + * Encodes the specified ListInstanceOSPoliciesCompliancesResponse message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse.verify|verify} messages. + * @param message ListInstanceOSPoliciesCompliancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstanceOSPoliciesCompliancesResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse.verify|verify} messages. + * @param message ListInstanceOSPoliciesCompliancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstanceOSPoliciesCompliancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstanceOSPoliciesCompliancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse; + + /** + * Decodes a ListInstanceOSPoliciesCompliancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstanceOSPoliciesCompliancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse; + + /** + * Verifies a ListInstanceOSPoliciesCompliancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstanceOSPoliciesCompliancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstanceOSPoliciesCompliancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse; + + /** + * Creates a plain object from a ListInstanceOSPoliciesCompliancesResponse message. Also converts values to other types if specified. + * @param message ListInstanceOSPoliciesCompliancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstanceOSPoliciesCompliancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstanceOSPoliciesCompliancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Inventory. */ + interface IInventory { + + /** Inventory name */ + name?: (string|null); + + /** Inventory osInfo */ + osInfo?: (google.cloud.osconfig.v1alpha.Inventory.IOsInfo|null); + + /** Inventory items */ + items?: ({ [k: string]: google.cloud.osconfig.v1alpha.Inventory.IItem }|null); + + /** Inventory updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Inventory. */ + class Inventory implements IInventory { + + /** + * Constructs a new Inventory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IInventory); + + /** Inventory name. */ + public name: string; + + /** Inventory osInfo. */ + public osInfo?: (google.cloud.osconfig.v1alpha.Inventory.IOsInfo|null); + + /** Inventory items. */ + public items: { [k: string]: google.cloud.osconfig.v1alpha.Inventory.IItem }; + + /** Inventory updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Inventory instance using the specified properties. + * @param [properties] Properties to set + * @returns Inventory instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IInventory): google.cloud.osconfig.v1alpha.Inventory; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.Inventory; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.Inventory; + + /** + * Verifies an Inventory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Inventory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Inventory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.Inventory; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @param message Inventory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.Inventory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Inventory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Inventory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Inventory { + + /** Properties of an OsInfo. */ + interface IOsInfo { + + /** OsInfo hostname */ + hostname?: (string|null); + + /** OsInfo longName */ + longName?: (string|null); + + /** OsInfo shortName */ + shortName?: (string|null); + + /** OsInfo version */ + version?: (string|null); + + /** OsInfo architecture */ + architecture?: (string|null); + + /** OsInfo kernelVersion */ + kernelVersion?: (string|null); + + /** OsInfo kernelRelease */ + kernelRelease?: (string|null); + + /** OsInfo osconfigAgentVersion */ + osconfigAgentVersion?: (string|null); + } + + /** Represents an OsInfo. */ + class OsInfo implements IOsInfo { + + /** + * Constructs a new OsInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.Inventory.IOsInfo); + + /** OsInfo hostname. */ + public hostname: string; + + /** OsInfo longName. */ + public longName: string; + + /** OsInfo shortName. */ + public shortName: string; + + /** OsInfo version. */ + public version: string; + + /** OsInfo architecture. */ + public architecture: string; + + /** OsInfo kernelVersion. */ + public kernelVersion: string; + + /** OsInfo kernelRelease. */ + public kernelRelease: string; + + /** OsInfo osconfigAgentVersion. */ + public osconfigAgentVersion: string; + + /** + * Creates a new OsInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OsInfo instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.Inventory.IOsInfo): google.cloud.osconfig.v1alpha.Inventory.OsInfo; + + /** + * Encodes the specified OsInfo message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.OsInfo.verify|verify} messages. + * @param message OsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.Inventory.IOsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OsInfo message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.OsInfo.verify|verify} messages. + * @param message OsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.Inventory.IOsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OsInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.Inventory.OsInfo; + + /** + * Decodes an OsInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.Inventory.OsInfo; + + /** + * Verifies an OsInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OsInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OsInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.Inventory.OsInfo; + + /** + * Creates a plain object from an OsInfo message. Also converts values to other types if specified. + * @param message OsInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.Inventory.OsInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OsInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OsInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Item. */ + interface IItem { + + /** Item id */ + id?: (string|null); + + /** Item originType */ + originType?: (google.cloud.osconfig.v1alpha.Inventory.Item.OriginType|keyof typeof google.cloud.osconfig.v1alpha.Inventory.Item.OriginType|null); + + /** Item createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Item updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Item type */ + type?: (google.cloud.osconfig.v1alpha.Inventory.Item.Type|keyof typeof google.cloud.osconfig.v1alpha.Inventory.Item.Type|null); + + /** Item installedPackage */ + installedPackage?: (google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage|null); + + /** Item availablePackage */ + availablePackage?: (google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage|null); + } + + /** Represents an Item. */ + class Item implements IItem { + + /** + * Constructs a new Item. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.Inventory.IItem); + + /** Item id. */ + public id: string; + + /** Item originType. */ + public originType: (google.cloud.osconfig.v1alpha.Inventory.Item.OriginType|keyof typeof google.cloud.osconfig.v1alpha.Inventory.Item.OriginType); + + /** Item createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Item updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Item type. */ + public type: (google.cloud.osconfig.v1alpha.Inventory.Item.Type|keyof typeof google.cloud.osconfig.v1alpha.Inventory.Item.Type); + + /** Item installedPackage. */ + public installedPackage?: (google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage|null); + + /** Item availablePackage. */ + public availablePackage?: (google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage|null); + + /** Item details. */ + public details?: ("installedPackage"|"availablePackage"); + + /** + * Creates a new Item instance using the specified properties. + * @param [properties] Properties to set + * @returns Item instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.Inventory.IItem): google.cloud.osconfig.v1alpha.Inventory.Item; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.Inventory.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.Inventory.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Item message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.Inventory.Item; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.Inventory.Item; + + /** + * Verifies an Item message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Item + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.Inventory.Item; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @param message Item + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.Inventory.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Item to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Item + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Item { + + /** OriginType enum. */ + enum OriginType { + ORIGIN_TYPE_UNSPECIFIED = 0, + INVENTORY_REPORT = 1 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + INSTALLED_PACKAGE = 1, + AVAILABLE_PACKAGE = 2 + } + } + + /** Properties of a SoftwarePackage. */ + interface ISoftwarePackage { + + /** SoftwarePackage yumPackage */ + yumPackage?: (google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null); + + /** SoftwarePackage aptPackage */ + aptPackage?: (google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPackage */ + zypperPackage?: (google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null); + + /** SoftwarePackage googetPackage */ + googetPackage?: (google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPatch */ + zypperPatch?: (google.cloud.osconfig.v1alpha.Inventory.IZypperPatch|null); + + /** SoftwarePackage wuaPackage */ + wuaPackage?: (google.cloud.osconfig.v1alpha.Inventory.IWindowsUpdatePackage|null); + + /** SoftwarePackage qfePackage */ + qfePackage?: (google.cloud.osconfig.v1alpha.Inventory.IWindowsQuickFixEngineeringPackage|null); + + /** SoftwarePackage cosPackage */ + cosPackage?: (google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null); + + /** SoftwarePackage windowsApplication */ + windowsApplication?: (google.cloud.osconfig.v1alpha.Inventory.IWindowsApplication|null); + } + + /** Represents a SoftwarePackage. */ + class SoftwarePackage implements ISoftwarePackage { + + /** + * Constructs a new SoftwarePackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage); + + /** SoftwarePackage yumPackage. */ + public yumPackage?: (google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null); + + /** SoftwarePackage aptPackage. */ + public aptPackage?: (google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPackage. */ + public zypperPackage?: (google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null); + + /** SoftwarePackage googetPackage. */ + public googetPackage?: (google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPatch. */ + public zypperPatch?: (google.cloud.osconfig.v1alpha.Inventory.IZypperPatch|null); + + /** SoftwarePackage wuaPackage. */ + public wuaPackage?: (google.cloud.osconfig.v1alpha.Inventory.IWindowsUpdatePackage|null); + + /** SoftwarePackage qfePackage. */ + public qfePackage?: (google.cloud.osconfig.v1alpha.Inventory.IWindowsQuickFixEngineeringPackage|null); + + /** SoftwarePackage cosPackage. */ + public cosPackage?: (google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null); + + /** SoftwarePackage windowsApplication. */ + public windowsApplication?: (google.cloud.osconfig.v1alpha.Inventory.IWindowsApplication|null); + + /** SoftwarePackage details. */ + public details?: ("yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|"windowsApplication"); + + /** + * Creates a new SoftwarePackage instance using the specified properties. + * @param [properties] Properties to set + * @returns SoftwarePackage instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage): google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage; + + /** + * Encodes the specified SoftwarePackage message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.verify|verify} messages. + * @param message SoftwarePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SoftwarePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.verify|verify} messages. + * @param message SoftwarePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage; + + /** + * Verifies a SoftwarePackage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SoftwarePackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SoftwarePackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage; + + /** + * Creates a plain object from a SoftwarePackage message. Also converts values to other types if specified. + * @param message SoftwarePackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SoftwarePackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SoftwarePackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VersionedPackage. */ + interface IVersionedPackage { + + /** VersionedPackage packageName */ + packageName?: (string|null); + + /** VersionedPackage architecture */ + architecture?: (string|null); + + /** VersionedPackage version */ + version?: (string|null); + } + + /** Represents a VersionedPackage. */ + class VersionedPackage implements IVersionedPackage { + + /** + * Constructs a new VersionedPackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage); + + /** VersionedPackage packageName. */ + public packageName: string; + + /** VersionedPackage architecture. */ + public architecture: string; + + /** VersionedPackage version. */ + public version: string; + + /** + * Creates a new VersionedPackage instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionedPackage instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage): google.cloud.osconfig.v1alpha.Inventory.VersionedPackage; + + /** + * Encodes the specified VersionedPackage message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.verify|verify} messages. + * @param message VersionedPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionedPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.verify|verify} messages. + * @param message VersionedPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.Inventory.VersionedPackage; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.Inventory.VersionedPackage; + + /** + * Verifies a VersionedPackage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VersionedPackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionedPackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.Inventory.VersionedPackage; + + /** + * Creates a plain object from a VersionedPackage message. Also converts values to other types if specified. + * @param message VersionedPackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.Inventory.VersionedPackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionedPackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VersionedPackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ZypperPatch. */ + interface IZypperPatch { + + /** ZypperPatch patchName */ + patchName?: (string|null); + + /** ZypperPatch category */ + category?: (string|null); + + /** ZypperPatch severity */ + severity?: (string|null); + + /** ZypperPatch summary */ + summary?: (string|null); + } + + /** Represents a ZypperPatch. */ + class ZypperPatch implements IZypperPatch { + + /** + * Constructs a new ZypperPatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.Inventory.IZypperPatch); + + /** ZypperPatch patchName. */ + public patchName: string; + + /** ZypperPatch category. */ + public category: string; + + /** ZypperPatch severity. */ + public severity: string; + + /** ZypperPatch summary. */ + public summary: string; + + /** + * Creates a new ZypperPatch instance using the specified properties. + * @param [properties] Properties to set + * @returns ZypperPatch instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.Inventory.IZypperPatch): google.cloud.osconfig.v1alpha.Inventory.ZypperPatch; + + /** + * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.ZypperPatch.verify|verify} messages. + * @param message ZypperPatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.ZypperPatch.verify|verify} messages. + * @param message ZypperPatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZypperPatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.Inventory.ZypperPatch; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZypperPatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.Inventory.ZypperPatch; + + /** + * Verifies a ZypperPatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ZypperPatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZypperPatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.Inventory.ZypperPatch; + + /** + * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. + * @param message ZypperPatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.Inventory.ZypperPatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZypperPatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ZypperPatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WindowsUpdatePackage. */ + interface IWindowsUpdatePackage { + + /** WindowsUpdatePackage title */ + title?: (string|null); + + /** WindowsUpdatePackage description */ + description?: (string|null); + + /** WindowsUpdatePackage categories */ + categories?: (google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory[]|null); + + /** WindowsUpdatePackage kbArticleIds */ + kbArticleIds?: (string[]|null); + + /** WindowsUpdatePackage supportUrl */ + supportUrl?: (string|null); + + /** WindowsUpdatePackage moreInfoUrls */ + moreInfoUrls?: (string[]|null); + + /** WindowsUpdatePackage updateId */ + updateId?: (string|null); + + /** WindowsUpdatePackage revisionNumber */ + revisionNumber?: (number|null); + + /** WindowsUpdatePackage lastDeploymentChangeTime */ + lastDeploymentChangeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a WindowsUpdatePackage. */ + class WindowsUpdatePackage implements IWindowsUpdatePackage { + + /** + * Constructs a new WindowsUpdatePackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.Inventory.IWindowsUpdatePackage); + + /** WindowsUpdatePackage title. */ + public title: string; + + /** WindowsUpdatePackage description. */ + public description: string; + + /** WindowsUpdatePackage categories. */ + public categories: google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory[]; + + /** WindowsUpdatePackage kbArticleIds. */ + public kbArticleIds: string[]; + + /** WindowsUpdatePackage supportUrl. */ + public supportUrl: string; + + /** WindowsUpdatePackage moreInfoUrls. */ + public moreInfoUrls: string[]; + + /** WindowsUpdatePackage updateId. */ + public updateId: string; + + /** WindowsUpdatePackage revisionNumber. */ + public revisionNumber: number; + + /** WindowsUpdatePackage lastDeploymentChangeTime. */ + public lastDeploymentChangeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new WindowsUpdatePackage instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsUpdatePackage instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.Inventory.IWindowsUpdatePackage): google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage; + + /** + * Encodes the specified WindowsUpdatePackage message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @param message WindowsUpdatePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.Inventory.IWindowsUpdatePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsUpdatePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @param message WindowsUpdatePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.Inventory.IWindowsUpdatePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsUpdatePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsUpdatePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage; + + /** + * Verifies a WindowsUpdatePackage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsUpdatePackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage; + + /** + * Creates a plain object from a WindowsUpdatePackage message. Also converts values to other types if specified. + * @param message WindowsUpdatePackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsUpdatePackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsUpdatePackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WindowsUpdatePackage { + + /** Properties of a WindowsUpdateCategory. */ + interface IWindowsUpdateCategory { + + /** WindowsUpdateCategory id */ + id?: (string|null); + + /** WindowsUpdateCategory name */ + name?: (string|null); + } + + /** Represents a WindowsUpdateCategory. */ + class WindowsUpdateCategory implements IWindowsUpdateCategory { + + /** + * Constructs a new WindowsUpdateCategory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory); + + /** WindowsUpdateCategory id. */ + public id: string; + + /** WindowsUpdateCategory name. */ + public name: string; + + /** + * Creates a new WindowsUpdateCategory instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsUpdateCategory instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory): google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Encodes the specified WindowsUpdateCategory message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @param message WindowsUpdateCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsUpdateCategory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @param message WindowsUpdateCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Verifies a WindowsUpdateCategory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WindowsUpdateCategory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsUpdateCategory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Creates a plain object from a WindowsUpdateCategory message. Also converts values to other types if specified. + * @param message WindowsUpdateCategory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsUpdateCategory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsUpdateCategory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a WindowsQuickFixEngineeringPackage. */ + interface IWindowsQuickFixEngineeringPackage { + + /** WindowsQuickFixEngineeringPackage caption */ + caption?: (string|null); + + /** WindowsQuickFixEngineeringPackage description */ + description?: (string|null); + + /** WindowsQuickFixEngineeringPackage hotFixId */ + hotFixId?: (string|null); + + /** WindowsQuickFixEngineeringPackage installTime */ + installTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a WindowsQuickFixEngineeringPackage. */ + class WindowsQuickFixEngineeringPackage implements IWindowsQuickFixEngineeringPackage { + + /** + * Constructs a new WindowsQuickFixEngineeringPackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.Inventory.IWindowsQuickFixEngineeringPackage); + + /** WindowsQuickFixEngineeringPackage caption. */ + public caption: string; + + /** WindowsQuickFixEngineeringPackage description. */ + public description: string; + + /** WindowsQuickFixEngineeringPackage hotFixId. */ + public hotFixId: string; + + /** WindowsQuickFixEngineeringPackage installTime. */ + public installTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new WindowsQuickFixEngineeringPackage instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsQuickFixEngineeringPackage instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.Inventory.IWindowsQuickFixEngineeringPackage): google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @param message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.Inventory.IWindowsQuickFixEngineeringPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @param message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.Inventory.IWindowsQuickFixEngineeringPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Verifies a WindowsQuickFixEngineeringPackage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WindowsQuickFixEngineeringPackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsQuickFixEngineeringPackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Creates a plain object from a WindowsQuickFixEngineeringPackage message. Also converts values to other types if specified. + * @param message WindowsQuickFixEngineeringPackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsQuickFixEngineeringPackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsQuickFixEngineeringPackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WindowsApplication. */ + interface IWindowsApplication { + + /** WindowsApplication displayName */ + displayName?: (string|null); + + /** WindowsApplication displayVersion */ + displayVersion?: (string|null); + + /** WindowsApplication publisher */ + publisher?: (string|null); + + /** WindowsApplication installDate */ + installDate?: (google.type.IDate|null); + + /** WindowsApplication helpLink */ + helpLink?: (string|null); + } + + /** Represents a WindowsApplication. */ + class WindowsApplication implements IWindowsApplication { + + /** + * Constructs a new WindowsApplication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.Inventory.IWindowsApplication); + + /** WindowsApplication displayName. */ + public displayName: string; + + /** WindowsApplication displayVersion. */ + public displayVersion: string; + + /** WindowsApplication publisher. */ + public publisher: string; + + /** WindowsApplication installDate. */ + public installDate?: (google.type.IDate|null); + + /** WindowsApplication helpLink. */ + public helpLink: string; + + /** + * Creates a new WindowsApplication instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsApplication instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.Inventory.IWindowsApplication): google.cloud.osconfig.v1alpha.Inventory.WindowsApplication; + + /** + * Encodes the specified WindowsApplication message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsApplication.verify|verify} messages. + * @param message WindowsApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.Inventory.IWindowsApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsApplication message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsApplication.verify|verify} messages. + * @param message WindowsApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.Inventory.IWindowsApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.Inventory.WindowsApplication; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.Inventory.WindowsApplication; + + /** + * Verifies a WindowsApplication message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WindowsApplication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsApplication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.Inventory.WindowsApplication; + + /** + * Creates a plain object from a WindowsApplication message. Also converts values to other types if specified. + * @param message WindowsApplication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.Inventory.WindowsApplication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsApplication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsApplication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GetInventoryRequest. */ + interface IGetInventoryRequest { + + /** GetInventoryRequest name */ + name?: (string|null); + + /** GetInventoryRequest view */ + view?: (google.cloud.osconfig.v1alpha.InventoryView|keyof typeof google.cloud.osconfig.v1alpha.InventoryView|null); + } + + /** Represents a GetInventoryRequest. */ + class GetInventoryRequest implements IGetInventoryRequest { + + /** + * Constructs a new GetInventoryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IGetInventoryRequest); + + /** GetInventoryRequest name. */ + public name: string; + + /** GetInventoryRequest view. */ + public view: (google.cloud.osconfig.v1alpha.InventoryView|keyof typeof google.cloud.osconfig.v1alpha.InventoryView); + + /** + * Creates a new GetInventoryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInventoryRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IGetInventoryRequest): google.cloud.osconfig.v1alpha.GetInventoryRequest; + + /** + * Encodes the specified GetInventoryRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetInventoryRequest.verify|verify} messages. + * @param message GetInventoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IGetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetInventoryRequest.verify|verify} messages. + * @param message GetInventoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IGetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.GetInventoryRequest; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.GetInventoryRequest; + + /** + * Verifies a GetInventoryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInventoryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.GetInventoryRequest; + + /** + * Creates a plain object from a GetInventoryRequest message. Also converts values to other types if specified. + * @param message GetInventoryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.GetInventoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInventoryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInventoryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInventoriesRequest. */ + interface IListInventoriesRequest { + + /** ListInventoriesRequest parent */ + parent?: (string|null); + + /** ListInventoriesRequest view */ + view?: (google.cloud.osconfig.v1alpha.InventoryView|keyof typeof google.cloud.osconfig.v1alpha.InventoryView|null); + + /** ListInventoriesRequest pageSize */ + pageSize?: (number|null); + + /** ListInventoriesRequest pageToken */ + pageToken?: (string|null); + + /** ListInventoriesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListInventoriesRequest. */ + class ListInventoriesRequest implements IListInventoriesRequest { + + /** + * Constructs a new ListInventoriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IListInventoriesRequest); + + /** ListInventoriesRequest parent. */ + public parent: string; + + /** ListInventoriesRequest view. */ + public view: (google.cloud.osconfig.v1alpha.InventoryView|keyof typeof google.cloud.osconfig.v1alpha.InventoryView); + + /** ListInventoriesRequest pageSize. */ + public pageSize: number; + + /** ListInventoriesRequest pageToken. */ + public pageToken: string; + + /** ListInventoriesRequest filter. */ + public filter: string; + + /** + * Creates a new ListInventoriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInventoriesRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IListInventoriesRequest): google.cloud.osconfig.v1alpha.ListInventoriesRequest; + + /** + * Encodes the specified ListInventoriesRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInventoriesRequest.verify|verify} messages. + * @param message ListInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IListInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInventoriesRequest.verify|verify} messages. + * @param message ListInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IListInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.ListInventoriesRequest; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.ListInventoriesRequest; + + /** + * Verifies a ListInventoriesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInventoriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.ListInventoriesRequest; + + /** + * Creates a plain object from a ListInventoriesRequest message. Also converts values to other types if specified. + * @param message ListInventoriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.ListInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInventoriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInventoriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInventoriesResponse. */ + interface IListInventoriesResponse { + + /** ListInventoriesResponse inventories */ + inventories?: (google.cloud.osconfig.v1alpha.IInventory[]|null); + + /** ListInventoriesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInventoriesResponse. */ + class ListInventoriesResponse implements IListInventoriesResponse { + + /** + * Constructs a new ListInventoriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IListInventoriesResponse); + + /** ListInventoriesResponse inventories. */ + public inventories: google.cloud.osconfig.v1alpha.IInventory[]; + + /** ListInventoriesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInventoriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInventoriesResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IListInventoriesResponse): google.cloud.osconfig.v1alpha.ListInventoriesResponse; + + /** + * Encodes the specified ListInventoriesResponse message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInventoriesResponse.verify|verify} messages. + * @param message ListInventoriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IListInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInventoriesResponse.verify|verify} messages. + * @param message ListInventoriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IListInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.ListInventoriesResponse; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.ListInventoriesResponse; + + /** + * Verifies a ListInventoriesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInventoriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.ListInventoriesResponse; + + /** + * Creates a plain object from a ListInventoriesResponse message. Also converts values to other types if specified. + * @param message ListInventoriesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.ListInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInventoriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInventoriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** InventoryView enum. */ + enum InventoryView { + INVENTORY_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + + /** Properties of a OSPolicy. */ + interface IOSPolicy { + + /** OSPolicy id */ + id?: (string|null); + + /** OSPolicy description */ + description?: (string|null); + + /** OSPolicy mode */ + mode?: (google.cloud.osconfig.v1alpha.OSPolicy.Mode|keyof typeof google.cloud.osconfig.v1alpha.OSPolicy.Mode|null); + + /** OSPolicy resourceGroups */ + resourceGroups?: (google.cloud.osconfig.v1alpha.OSPolicy.IResourceGroup[]|null); + + /** OSPolicy allowNoResourceGroupMatch */ + allowNoResourceGroupMatch?: (boolean|null); + } + + /** Represents a OSPolicy. */ + class OSPolicy implements IOSPolicy { + + /** + * Constructs a new OSPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IOSPolicy); + + /** OSPolicy id. */ + public id: string; + + /** OSPolicy description. */ + public description: string; + + /** OSPolicy mode. */ + public mode: (google.cloud.osconfig.v1alpha.OSPolicy.Mode|keyof typeof google.cloud.osconfig.v1alpha.OSPolicy.Mode); + + /** OSPolicy resourceGroups. */ + public resourceGroups: google.cloud.osconfig.v1alpha.OSPolicy.IResourceGroup[]; + + /** OSPolicy allowNoResourceGroupMatch. */ + public allowNoResourceGroupMatch: boolean; + + /** + * Creates a new OSPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicy instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IOSPolicy): google.cloud.osconfig.v1alpha.OSPolicy; + + /** + * Encodes the specified OSPolicy message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.verify|verify} messages. + * @param message OSPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IOSPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicy message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.verify|verify} messages. + * @param message OSPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IOSPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy; + + /** + * Decodes a OSPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy; + + /** + * Verifies a OSPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy; + + /** + * Creates a plain object from a OSPolicy message. Also converts values to other types if specified. + * @param message OSPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicy { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + VALIDATION = 1, + ENFORCEMENT = 2 + } + + /** Properties of a OSFilter. */ + interface IOSFilter { + + /** OSFilter osShortName */ + osShortName?: (string|null); + + /** OSFilter osVersion */ + osVersion?: (string|null); + } + + /** Represents a OSFilter. */ + class OSFilter implements IOSFilter { + + /** + * Constructs a new OSFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.IOSFilter); + + /** OSFilter osShortName. */ + public osShortName: string; + + /** OSFilter osVersion. */ + public osVersion: string; + + /** + * Creates a new OSFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns OSFilter instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.IOSFilter): google.cloud.osconfig.v1alpha.OSPolicy.OSFilter; + + /** + * Encodes the specified OSFilter message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.OSFilter.verify|verify} messages. + * @param message OSFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.IOSFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSFilter message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.OSFilter.verify|verify} messages. + * @param message OSFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.IOSFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.OSFilter; + + /** + * Decodes a OSFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.OSFilter; + + /** + * Verifies a OSFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.OSFilter; + + /** + * Creates a plain object from a OSFilter message. Also converts values to other types if specified. + * @param message OSFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.OSFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InventoryFilter. */ + interface IInventoryFilter { + + /** InventoryFilter osShortName */ + osShortName?: (string|null); + + /** InventoryFilter osVersion */ + osVersion?: (string|null); + } + + /** Represents an InventoryFilter. */ + class InventoryFilter implements IInventoryFilter { + + /** + * Constructs a new InventoryFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.IInventoryFilter); + + /** InventoryFilter osShortName. */ + public osShortName: string; + + /** InventoryFilter osVersion. */ + public osVersion: string; + + /** + * Creates a new InventoryFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns InventoryFilter instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.IInventoryFilter): google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter; + + /** + * Encodes the specified InventoryFilter message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter.verify|verify} messages. + * @param message InventoryFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.IInventoryFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InventoryFilter message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter.verify|verify} messages. + * @param message InventoryFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.IInventoryFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InventoryFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InventoryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter; + + /** + * Decodes an InventoryFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InventoryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter; + + /** + * Verifies an InventoryFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InventoryFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InventoryFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter; + + /** + * Creates a plain object from an InventoryFilter message. Also converts values to other types if specified. + * @param message InventoryFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InventoryFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InventoryFilter + * @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 id */ + id?: (string|null); + + /** Resource pkg */ + pkg?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IPackageResource|null); + + /** Resource repository */ + repository?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IRepositoryResource|null); + + /** Resource exec */ + exec?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IExecResource|null); + + /** Resource file */ + file?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFileResource|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.IResource); + + /** Resource id. */ + public id: string; + + /** Resource pkg. */ + public pkg?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IPackageResource|null); + + /** Resource repository. */ + public repository?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IRepositoryResource|null); + + /** Resource exec. */ + public exec?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IExecResource|null); + + /** Resource file. */ + public file?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFileResource|null); + + /** Resource resourceType. */ + public resourceType?: ("pkg"|"repository"|"exec"|"file"); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.IResource): google.cloud.osconfig.v1alpha.OSPolicy.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.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.osconfig.v1alpha.OSPolicy.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.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.osconfig.v1alpha.OSPolicy.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.osconfig.v1alpha.OSPolicy.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.osconfig.v1alpha.OSPolicy.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.osconfig.v1alpha.OSPolicy.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.osconfig.v1alpha.OSPolicy.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Resource { + + /** Properties of a File. */ + interface IFile { + + /** File remote */ + remote?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IRemote|null); + + /** File gcs */ + gcs?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IGcs|null); + + /** File localPath */ + localPath?: (string|null); + + /** File allowInsecure */ + allowInsecure?: (boolean|null); + } + + /** Represents a File. */ + class File implements IFile { + + /** + * Constructs a new File. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile); + + /** File remote. */ + public remote?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IRemote|null); + + /** File gcs. */ + public gcs?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IGcs|null); + + /** File localPath. */ + public localPath?: (string|null); + + /** File allowInsecure. */ + public allowInsecure: boolean; + + /** File type. */ + public type?: ("remote"|"gcs"|"localPath"); + + /** + * Creates a new File instance using the specified properties. + * @param [properties] Properties to set + * @returns File instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile): google.cloud.osconfig.v1alpha.OSPolicy.Resource.File; + + /** + * Encodes the specified File message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.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.osconfig.v1alpha.OSPolicy.Resource.IFile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.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.osconfig.v1alpha.OSPolicy.Resource.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.osconfig.v1alpha.OSPolicy.Resource.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.osconfig.v1alpha.OSPolicy.Resource.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.osconfig.v1alpha.OSPolicy.Resource.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.osconfig.v1alpha.OSPolicy.Resource.File, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this File to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for File + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace File { + + /** Properties of a Remote. */ + interface IRemote { + + /** Remote uri */ + uri?: (string|null); + + /** Remote sha256Checksum */ + sha256Checksum?: (string|null); + } + + /** Represents a Remote. */ + class Remote implements IRemote { + + /** + * Constructs a new Remote. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IRemote); + + /** Remote uri. */ + public uri: string; + + /** Remote sha256Checksum. */ + public sha256Checksum: string; + + /** + * Creates a new Remote instance using the specified properties. + * @param [properties] Properties to set + * @returns Remote instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IRemote): google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote; + + /** + * Encodes the specified Remote message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote.verify|verify} messages. + * @param message Remote message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IRemote, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Remote message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote.verify|verify} messages. + * @param message Remote message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IRemote, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Remote message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Remote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote; + + /** + * Decodes a Remote message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Remote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote; + + /** + * Verifies a Remote message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Remote message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Remote + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote; + + /** + * Creates a plain object from a Remote message. Also converts values to other types if specified. + * @param message Remote + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Remote to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Remote + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Gcs. */ + interface IGcs { + + /** Gcs bucket */ + bucket?: (string|null); + + /** Gcs object */ + object?: (string|null); + + /** Gcs generation */ + generation?: (number|Long|string|null); + } + + /** Represents a Gcs. */ + class Gcs implements IGcs { + + /** + * Constructs a new Gcs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IGcs); + + /** Gcs bucket. */ + public bucket: string; + + /** Gcs object. */ + public object: string; + + /** Gcs generation. */ + public generation: (number|Long|string); + + /** + * Creates a new Gcs instance using the specified properties. + * @param [properties] Properties to set + * @returns Gcs instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IGcs): google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs; + + /** + * Encodes the specified Gcs message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs.verify|verify} messages. + * @param message Gcs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IGcs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Gcs message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs.verify|verify} messages. + * @param message Gcs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IGcs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Gcs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Gcs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs; + + /** + * Decodes a Gcs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Gcs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs; + + /** + * Verifies a Gcs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Gcs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Gcs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs; + + /** + * Creates a plain object from a Gcs message. Also converts values to other types if specified. + * @param message Gcs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Gcs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Gcs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PackageResource. */ + interface IPackageResource { + + /** PackageResource desiredState */ + desiredState?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.DesiredState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.DesiredState|null); + + /** PackageResource apt */ + apt?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IAPT|null); + + /** PackageResource deb */ + deb?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IDeb|null); + + /** PackageResource yum */ + yum?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IYUM|null); + + /** PackageResource zypper */ + zypper?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IZypper|null); + + /** PackageResource rpm */ + rpm?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IRPM|null); + + /** PackageResource googet */ + googet?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IGooGet|null); + + /** PackageResource msi */ + msi?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IMSI|null); + } + + /** Represents a PackageResource. */ + class PackageResource implements IPackageResource { + + /** + * Constructs a new PackageResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IPackageResource); + + /** PackageResource desiredState. */ + public desiredState: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.DesiredState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.DesiredState); + + /** PackageResource apt. */ + public apt?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IAPT|null); + + /** PackageResource deb. */ + public deb?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IDeb|null); + + /** PackageResource yum. */ + public yum?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IYUM|null); + + /** PackageResource zypper. */ + public zypper?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IZypper|null); + + /** PackageResource rpm. */ + public rpm?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IRPM|null); + + /** PackageResource googet. */ + public googet?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IGooGet|null); + + /** PackageResource msi. */ + public msi?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IMSI|null); + + /** PackageResource systemPackage. */ + public systemPackage?: ("apt"|"deb"|"yum"|"zypper"|"rpm"|"googet"|"msi"); + + /** + * Creates a new PackageResource instance using the specified properties. + * @param [properties] Properties to set + * @returns PackageResource instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IPackageResource): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource; + + /** + * Encodes the specified PackageResource message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.verify|verify} messages. + * @param message PackageResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IPackageResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PackageResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.verify|verify} messages. + * @param message PackageResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IPackageResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PackageResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PackageResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource; + + /** + * Decodes a PackageResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PackageResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource; + + /** + * Verifies a PackageResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PackageResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PackageResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource; + + /** + * Creates a plain object from a PackageResource message. Also converts values to other types if specified. + * @param message PackageResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PackageResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PackageResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PackageResource { + + /** DesiredState enum. */ + enum DesiredState { + DESIRED_STATE_UNSPECIFIED = 0, + INSTALLED = 1, + REMOVED = 2 + } + + /** Properties of a Deb. */ + interface IDeb { + + /** Deb source */ + source?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null); + + /** Deb pullDeps */ + pullDeps?: (boolean|null); + } + + /** Represents a Deb. */ + class Deb implements IDeb { + + /** + * Constructs a new Deb. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IDeb); + + /** Deb source. */ + public source?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null); + + /** Deb pullDeps. */ + public pullDeps: boolean; + + /** + * Creates a new Deb instance using the specified properties. + * @param [properties] Properties to set + * @returns Deb instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IDeb): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb; + + /** + * Encodes the specified Deb message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb.verify|verify} messages. + * @param message Deb message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IDeb, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deb message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb.verify|verify} messages. + * @param message Deb message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IDeb, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deb message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deb + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb; + + /** + * Decodes a Deb message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deb + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb; + + /** + * Verifies a Deb message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Deb message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deb + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb; + + /** + * Creates a plain object from a Deb message. Also converts values to other types if specified. + * @param message Deb + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deb to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deb + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a APT. */ + interface IAPT { + + /** APT name */ + name?: (string|null); + } + + /** Represents a APT. */ + class APT implements IAPT { + + /** + * Constructs a new APT. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IAPT); + + /** APT name. */ + public name: string; + + /** + * Creates a new APT instance using the specified properties. + * @param [properties] Properties to set + * @returns APT instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IAPT): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT; + + /** + * Encodes the specified APT message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT.verify|verify} messages. + * @param message APT message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IAPT, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified APT message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT.verify|verify} messages. + * @param message APT message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IAPT, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a APT message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns APT + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT; + + /** + * Decodes a APT message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns APT + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT; + + /** + * Verifies a APT message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a APT message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns APT + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT; + + /** + * Creates a plain object from a APT message. Also converts values to other types if specified. + * @param message APT + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this APT to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for APT + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RPM. */ + interface IRPM { + + /** RPM source */ + source?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null); + + /** RPM pullDeps */ + pullDeps?: (boolean|null); + } + + /** Represents a RPM. */ + class RPM implements IRPM { + + /** + * Constructs a new RPM. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IRPM); + + /** RPM source. */ + public source?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null); + + /** RPM pullDeps. */ + public pullDeps: boolean; + + /** + * Creates a new RPM instance using the specified properties. + * @param [properties] Properties to set + * @returns RPM instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IRPM): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM; + + /** + * Encodes the specified RPM message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM.verify|verify} messages. + * @param message RPM message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IRPM, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RPM message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM.verify|verify} messages. + * @param message RPM message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IRPM, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RPM message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RPM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM; + + /** + * Decodes a RPM message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RPM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM; + + /** + * Verifies a RPM message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RPM message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RPM + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM; + + /** + * Creates a plain object from a RPM message. Also converts values to other types if specified. + * @param message RPM + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RPM to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RPM + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a YUM. */ + interface IYUM { + + /** YUM name */ + name?: (string|null); + } + + /** Represents a YUM. */ + class YUM implements IYUM { + + /** + * Constructs a new YUM. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IYUM); + + /** YUM name. */ + public name: string; + + /** + * Creates a new YUM instance using the specified properties. + * @param [properties] Properties to set + * @returns YUM instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IYUM): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM; + + /** + * Encodes the specified YUM message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM.verify|verify} messages. + * @param message YUM message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IYUM, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified YUM message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM.verify|verify} messages. + * @param message YUM message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IYUM, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a YUM message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns YUM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM; + + /** + * Decodes a YUM message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns YUM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM; + + /** + * Verifies a YUM message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a YUM message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns YUM + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM; + + /** + * Creates a plain object from a YUM message. Also converts values to other types if specified. + * @param message YUM + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this YUM to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for YUM + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Zypper. */ + interface IZypper { + + /** Zypper name */ + name?: (string|null); + } + + /** Represents a Zypper. */ + class Zypper implements IZypper { + + /** + * Constructs a new Zypper. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IZypper); + + /** Zypper name. */ + public name: string; + + /** + * Creates a new Zypper instance using the specified properties. + * @param [properties] Properties to set + * @returns Zypper instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IZypper): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper; + + /** + * Encodes the specified Zypper message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper.verify|verify} messages. + * @param message Zypper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IZypper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Zypper message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper.verify|verify} messages. + * @param message Zypper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IZypper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Zypper message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Zypper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper; + + /** + * Decodes a Zypper message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Zypper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper; + + /** + * Verifies a Zypper message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Zypper message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Zypper + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper; + + /** + * Creates a plain object from a Zypper message. Also converts values to other types if specified. + * @param message Zypper + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Zypper to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Zypper + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GooGet. */ + interface IGooGet { + + /** GooGet name */ + name?: (string|null); + } + + /** Represents a GooGet. */ + class GooGet implements IGooGet { + + /** + * Constructs a new GooGet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IGooGet); + + /** GooGet name. */ + public name: string; + + /** + * Creates a new GooGet instance using the specified properties. + * @param [properties] Properties to set + * @returns GooGet instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IGooGet): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet; + + /** + * Encodes the specified GooGet message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet.verify|verify} messages. + * @param message GooGet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IGooGet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GooGet message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet.verify|verify} messages. + * @param message GooGet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IGooGet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GooGet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GooGet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet; + + /** + * Decodes a GooGet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GooGet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet; + + /** + * Verifies a GooGet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GooGet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GooGet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet; + + /** + * Creates a plain object from a GooGet message. Also converts values to other types if specified. + * @param message GooGet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GooGet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GooGet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MSI. */ + interface IMSI { + + /** MSI source */ + source?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null); + + /** MSI properties */ + properties?: (string[]|null); + } + + /** Represents a MSI. */ + class MSI implements IMSI { + + /** + * Constructs a new MSI. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IMSI); + + /** MSI source. */ + public source?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null); + + /** MSI properties. */ + public properties: string[]; + + /** + * Creates a new MSI instance using the specified properties. + * @param [properties] Properties to set + * @returns MSI instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IMSI): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI; + + /** + * Encodes the specified MSI message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI.verify|verify} messages. + * @param message MSI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IMSI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MSI message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI.verify|verify} messages. + * @param message MSI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IMSI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MSI message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MSI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI; + + /** + * Decodes a MSI message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MSI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI; + + /** + * Verifies a MSI message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MSI message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MSI + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI; + + /** + * Creates a plain object from a MSI message. Also converts values to other types if specified. + * @param message MSI + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MSI to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MSI + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RepositoryResource. */ + interface IRepositoryResource { + + /** RepositoryResource apt */ + apt?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IAptRepository|null); + + /** RepositoryResource yum */ + yum?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IYumRepository|null); + + /** RepositoryResource zypper */ + zypper?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IZypperRepository|null); + + /** RepositoryResource goo */ + goo?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IGooRepository|null); + } + + /** Represents a RepositoryResource. */ + class RepositoryResource implements IRepositoryResource { + + /** + * Constructs a new RepositoryResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IRepositoryResource); + + /** RepositoryResource apt. */ + public apt?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IAptRepository|null); + + /** RepositoryResource yum. */ + public yum?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IYumRepository|null); + + /** RepositoryResource zypper. */ + public zypper?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IZypperRepository|null); + + /** RepositoryResource goo. */ + public goo?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IGooRepository|null); + + /** RepositoryResource repository. */ + public repository?: ("apt"|"yum"|"zypper"|"goo"); + + /** + * Creates a new RepositoryResource instance using the specified properties. + * @param [properties] Properties to set + * @returns RepositoryResource instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IRepositoryResource): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource; + + /** + * Encodes the specified RepositoryResource message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.verify|verify} messages. + * @param message RepositoryResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IRepositoryResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RepositoryResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.verify|verify} messages. + * @param message RepositoryResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IRepositoryResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RepositoryResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RepositoryResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource; + + /** + * Decodes a RepositoryResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RepositoryResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource; + + /** + * Verifies a RepositoryResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RepositoryResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RepositoryResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource; + + /** + * Creates a plain object from a RepositoryResource message. Also converts values to other types if specified. + * @param message RepositoryResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RepositoryResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RepositoryResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RepositoryResource { + + /** Properties of an AptRepository. */ + interface IAptRepository { + + /** AptRepository archiveType */ + archiveType?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType|keyof typeof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType|null); + + /** AptRepository uri */ + uri?: (string|null); + + /** AptRepository distribution */ + distribution?: (string|null); + + /** AptRepository components */ + components?: (string[]|null); + + /** AptRepository gpgKey */ + gpgKey?: (string|null); + } + + /** Represents an AptRepository. */ + class AptRepository implements IAptRepository { + + /** + * Constructs a new AptRepository. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IAptRepository); + + /** AptRepository archiveType. */ + public archiveType: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType|keyof typeof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType); + + /** AptRepository uri. */ + public uri: string; + + /** AptRepository distribution. */ + public distribution: string; + + /** AptRepository components. */ + public components: string[]; + + /** AptRepository gpgKey. */ + public gpgKey: string; + + /** + * Creates a new AptRepository instance using the specified properties. + * @param [properties] Properties to set + * @returns AptRepository instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IAptRepository): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository; + + /** + * Encodes the specified AptRepository message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.verify|verify} messages. + * @param message AptRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IAptRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AptRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.verify|verify} messages. + * @param message AptRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IAptRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AptRepository message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AptRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository; + + /** + * Decodes an AptRepository message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AptRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository; + + /** + * Verifies an AptRepository message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AptRepository message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AptRepository + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository; + + /** + * Creates a plain object from an AptRepository message. Also converts values to other types if specified. + * @param message AptRepository + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AptRepository to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AptRepository + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AptRepository { + + /** ArchiveType enum. */ + enum ArchiveType { + ARCHIVE_TYPE_UNSPECIFIED = 0, + DEB = 1, + DEB_SRC = 2 + } + } + + /** Properties of a YumRepository. */ + interface IYumRepository { + + /** YumRepository id */ + id?: (string|null); + + /** YumRepository displayName */ + displayName?: (string|null); + + /** YumRepository baseUrl */ + baseUrl?: (string|null); + + /** YumRepository gpgKeys */ + gpgKeys?: (string[]|null); + } + + /** Represents a YumRepository. */ + class YumRepository implements IYumRepository { + + /** + * Constructs a new YumRepository. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IYumRepository); + + /** YumRepository id. */ + public id: string; + + /** YumRepository displayName. */ + public displayName: string; + + /** YumRepository baseUrl. */ + public baseUrl: string; + + /** YumRepository gpgKeys. */ + public gpgKeys: string[]; + + /** + * Creates a new YumRepository instance using the specified properties. + * @param [properties] Properties to set + * @returns YumRepository instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IYumRepository): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository; + + /** + * Encodes the specified YumRepository message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository.verify|verify} messages. + * @param message YumRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IYumRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified YumRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository.verify|verify} messages. + * @param message YumRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IYumRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a YumRepository message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns YumRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository; + + /** + * Decodes a YumRepository message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns YumRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository; + + /** + * Verifies a YumRepository message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a YumRepository message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns YumRepository + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository; + + /** + * Creates a plain object from a YumRepository message. Also converts values to other types if specified. + * @param message YumRepository + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this YumRepository to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for YumRepository + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ZypperRepository. */ + interface IZypperRepository { + + /** ZypperRepository id */ + id?: (string|null); + + /** ZypperRepository displayName */ + displayName?: (string|null); + + /** ZypperRepository baseUrl */ + baseUrl?: (string|null); + + /** ZypperRepository gpgKeys */ + gpgKeys?: (string[]|null); + } + + /** Represents a ZypperRepository. */ + class ZypperRepository implements IZypperRepository { + + /** + * Constructs a new ZypperRepository. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IZypperRepository); + + /** ZypperRepository id. */ + public id: string; + + /** ZypperRepository displayName. */ + public displayName: string; + + /** ZypperRepository baseUrl. */ + public baseUrl: string; + + /** ZypperRepository gpgKeys. */ + public gpgKeys: string[]; + + /** + * Creates a new ZypperRepository instance using the specified properties. + * @param [properties] Properties to set + * @returns ZypperRepository instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IZypperRepository): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository; + + /** + * Encodes the specified ZypperRepository message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository.verify|verify} messages. + * @param message ZypperRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IZypperRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZypperRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository.verify|verify} messages. + * @param message ZypperRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IZypperRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZypperRepository message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZypperRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository; + + /** + * Decodes a ZypperRepository message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZypperRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository; + + /** + * Verifies a ZypperRepository message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ZypperRepository message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZypperRepository + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository; + + /** + * Creates a plain object from a ZypperRepository message. Also converts values to other types if specified. + * @param message ZypperRepository + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZypperRepository to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ZypperRepository + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GooRepository. */ + interface IGooRepository { + + /** GooRepository name */ + name?: (string|null); + + /** GooRepository url */ + url?: (string|null); + } + + /** Represents a GooRepository. */ + class GooRepository implements IGooRepository { + + /** + * Constructs a new GooRepository. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IGooRepository); + + /** GooRepository name. */ + public name: string; + + /** GooRepository url. */ + public url: string; + + /** + * Creates a new GooRepository instance using the specified properties. + * @param [properties] Properties to set + * @returns GooRepository instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IGooRepository): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository; + + /** + * Encodes the specified GooRepository message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository.verify|verify} messages. + * @param message GooRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IGooRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GooRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository.verify|verify} messages. + * @param message GooRepository message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IGooRepository, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GooRepository message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GooRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository; + + /** + * Decodes a GooRepository message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GooRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository; + + /** + * Verifies a GooRepository message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GooRepository message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GooRepository + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository; + + /** + * Creates a plain object from a GooRepository message. Also converts values to other types if specified. + * @param message GooRepository + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GooRepository to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GooRepository + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExecResource. */ + interface IExecResource { + + /** ExecResource validate */ + validate?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec|null); + + /** ExecResource enforce */ + enforce?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec|null); + } + + /** Represents an ExecResource. */ + class ExecResource implements IExecResource { + + /** + * Constructs a new ExecResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IExecResource); + + /** ExecResource validate. */ + public validate?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec|null); + + /** ExecResource enforce. */ + public enforce?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec|null); + + /** + * Creates a new ExecResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecResource instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IExecResource): google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource; + + /** + * Encodes the specified ExecResource message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.verify|verify} messages. + * @param message ExecResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IExecResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.verify|verify} messages. + * @param message ExecResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IExecResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource; + + /** + * Decodes an ExecResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource; + + /** + * Verifies an ExecResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource; + + /** + * Creates a plain object from an ExecResource message. Also converts values to other types if specified. + * @param message ExecResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecResource { + + /** Properties of an Exec. */ + interface IExec { + + /** Exec file */ + file?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null); + + /** Exec script */ + script?: (string|null); + + /** Exec args */ + args?: (string[]|null); + + /** Exec interpreter */ + interpreter?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.Interpreter|keyof typeof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.Interpreter|null); + + /** Exec outputFilePath */ + outputFilePath?: (string|null); + } + + /** Represents an Exec. */ + class Exec implements IExec { + + /** + * Constructs a new Exec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec); + + /** Exec file. */ + public file?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null); + + /** Exec script. */ + public script?: (string|null); + + /** Exec args. */ + public args: string[]; + + /** Exec interpreter. */ + public interpreter: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.Interpreter|keyof typeof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.Interpreter); + + /** Exec outputFilePath. */ + public outputFilePath: string; + + /** Exec source. */ + public source?: ("file"|"script"); + + /** + * Creates a new Exec instance using the specified properties. + * @param [properties] Properties to set + * @returns Exec instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec): google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec; + + /** + * Encodes the specified Exec message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.verify|verify} messages. + * @param message Exec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Exec message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.verify|verify} messages. + * @param message Exec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Exec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Exec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec; + + /** + * Decodes an Exec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Exec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec; + + /** + * Verifies an Exec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Exec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Exec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec; + + /** + * Creates a plain object from an Exec message. Also converts values to other types if specified. + * @param message Exec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Exec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Exec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Exec { + + /** Interpreter enum. */ + enum Interpreter { + INTERPRETER_UNSPECIFIED = 0, + NONE = 1, + SHELL = 2, + POWERSHELL = 3 + } + } + } + + /** Properties of a FileResource. */ + interface IFileResource { + + /** FileResource file */ + file?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null); + + /** FileResource content */ + content?: (string|null); + + /** FileResource path */ + path?: (string|null); + + /** FileResource state */ + state?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.DesiredState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.DesiredState|null); + + /** FileResource permissions */ + permissions?: (string|null); + } + + /** Represents a FileResource. */ + class FileResource implements IFileResource { + + /** + * Constructs a new FileResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFileResource); + + /** FileResource file. */ + public file?: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null); + + /** FileResource content. */ + public content?: (string|null); + + /** FileResource path. */ + public path: string; + + /** FileResource state. */ + public state: (google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.DesiredState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.DesiredState); + + /** FileResource permissions. */ + public permissions: string; + + /** FileResource source. */ + public source?: ("file"|"content"); + + /** + * Creates a new FileResource instance using the specified properties. + * @param [properties] Properties to set + * @returns FileResource instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFileResource): google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource; + + /** + * Encodes the specified FileResource message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.verify|verify} messages. + * @param message FileResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFileResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.verify|verify} messages. + * @param message FileResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFileResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource; + + /** + * Decodes a FileResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource; + + /** + * Verifies a FileResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource; + + /** + * Creates a plain object from a FileResource message. Also converts values to other types if specified. + * @param message FileResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileResource { + + /** DesiredState enum. */ + enum DesiredState { + DESIRED_STATE_UNSPECIFIED = 0, + PRESENT = 1, + ABSENT = 2, + CONTENTS_MATCH = 3 + } + } + } + + /** Properties of a ResourceGroup. */ + interface IResourceGroup { + + /** ResourceGroup osFilter */ + osFilter?: (google.cloud.osconfig.v1alpha.OSPolicy.IOSFilter|null); + + /** ResourceGroup inventoryFilters */ + inventoryFilters?: (google.cloud.osconfig.v1alpha.OSPolicy.IInventoryFilter[]|null); + + /** ResourceGroup resources */ + resources?: (google.cloud.osconfig.v1alpha.OSPolicy.IResource[]|null); + } + + /** Represents a ResourceGroup. */ + class ResourceGroup implements IResourceGroup { + + /** + * Constructs a new ResourceGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicy.IResourceGroup); + + /** ResourceGroup osFilter. */ + public osFilter?: (google.cloud.osconfig.v1alpha.OSPolicy.IOSFilter|null); + + /** ResourceGroup inventoryFilters. */ + public inventoryFilters: google.cloud.osconfig.v1alpha.OSPolicy.IInventoryFilter[]; + + /** ResourceGroup resources. */ + public resources: google.cloud.osconfig.v1alpha.OSPolicy.IResource[]; + + /** + * Creates a new ResourceGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceGroup instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicy.IResourceGroup): google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup; + + /** + * Encodes the specified ResourceGroup message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.verify|verify} messages. + * @param message ResourceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicy.IResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceGroup message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.verify|verify} messages. + * @param message ResourceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicy.IResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup; + + /** + * Decodes a ResourceGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup; + + /** + * Verifies a ResourceGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup; + + /** + * Creates a plain object from a ResourceGroup message. Also converts values to other types if specified. + * @param message ResourceGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GetOSPolicyAssignmentReportRequest. */ + interface IGetOSPolicyAssignmentReportRequest { + + /** GetOSPolicyAssignmentReportRequest name */ + name?: (string|null); + } + + /** Represents a GetOSPolicyAssignmentReportRequest. */ + class GetOSPolicyAssignmentReportRequest implements IGetOSPolicyAssignmentReportRequest { + + /** + * Constructs a new GetOSPolicyAssignmentReportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest); + + /** GetOSPolicyAssignmentReportRequest name. */ + public name: string; + + /** + * Creates a new GetOSPolicyAssignmentReportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOSPolicyAssignmentReportRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest): google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest; + + /** + * Encodes the specified GetOSPolicyAssignmentReportRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest.verify|verify} messages. + * @param message GetOSPolicyAssignmentReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOSPolicyAssignmentReportRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest.verify|verify} messages. + * @param message GetOSPolicyAssignmentReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOSPolicyAssignmentReportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOSPolicyAssignmentReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest; + + /** + * Decodes a GetOSPolicyAssignmentReportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOSPolicyAssignmentReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest; + + /** + * Verifies a GetOSPolicyAssignmentReportRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOSPolicyAssignmentReportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOSPolicyAssignmentReportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest; + + /** + * Creates a plain object from a GetOSPolicyAssignmentReportRequest message. Also converts values to other types if specified. + * @param message GetOSPolicyAssignmentReportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOSPolicyAssignmentReportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOSPolicyAssignmentReportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOSPolicyAssignmentReportsRequest. */ + interface IListOSPolicyAssignmentReportsRequest { + + /** ListOSPolicyAssignmentReportsRequest parent */ + parent?: (string|null); + + /** ListOSPolicyAssignmentReportsRequest pageSize */ + pageSize?: (number|null); + + /** ListOSPolicyAssignmentReportsRequest filter */ + filter?: (string|null); + + /** ListOSPolicyAssignmentReportsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOSPolicyAssignmentReportsRequest. */ + class ListOSPolicyAssignmentReportsRequest implements IListOSPolicyAssignmentReportsRequest { + + /** + * Constructs a new ListOSPolicyAssignmentReportsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest); + + /** ListOSPolicyAssignmentReportsRequest parent. */ + public parent: string; + + /** ListOSPolicyAssignmentReportsRequest pageSize. */ + public pageSize: number; + + /** ListOSPolicyAssignmentReportsRequest filter. */ + public filter: string; + + /** ListOSPolicyAssignmentReportsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOSPolicyAssignmentReportsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOSPolicyAssignmentReportsRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest.verify|verify} messages. + * @param message ListOSPolicyAssignmentReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest.verify|verify} messages. + * @param message ListOSPolicyAssignmentReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOSPolicyAssignmentReportsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOSPolicyAssignmentReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest; + + /** + * Decodes a ListOSPolicyAssignmentReportsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOSPolicyAssignmentReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest; + + /** + * Verifies a ListOSPolicyAssignmentReportsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOSPolicyAssignmentReportsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOSPolicyAssignmentReportsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest; + + /** + * Creates a plain object from a ListOSPolicyAssignmentReportsRequest message. Also converts values to other types if specified. + * @param message ListOSPolicyAssignmentReportsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOSPolicyAssignmentReportsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOSPolicyAssignmentReportsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOSPolicyAssignmentReportsResponse. */ + interface IListOSPolicyAssignmentReportsResponse { + + /** ListOSPolicyAssignmentReportsResponse osPolicyAssignmentReports */ + osPolicyAssignmentReports?: (google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport[]|null); + + /** ListOSPolicyAssignmentReportsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOSPolicyAssignmentReportsResponse. */ + class ListOSPolicyAssignmentReportsResponse implements IListOSPolicyAssignmentReportsResponse { + + /** + * Constructs a new ListOSPolicyAssignmentReportsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse); + + /** ListOSPolicyAssignmentReportsResponse osPolicyAssignmentReports. */ + public osPolicyAssignmentReports: google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport[]; + + /** ListOSPolicyAssignmentReportsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOSPolicyAssignmentReportsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOSPolicyAssignmentReportsResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsResponse message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse.verify|verify} messages. + * @param message ListOSPolicyAssignmentReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse.verify|verify} messages. + * @param message ListOSPolicyAssignmentReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOSPolicyAssignmentReportsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOSPolicyAssignmentReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse; + + /** + * Decodes a ListOSPolicyAssignmentReportsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOSPolicyAssignmentReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse; + + /** + * Verifies a ListOSPolicyAssignmentReportsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOSPolicyAssignmentReportsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOSPolicyAssignmentReportsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse; + + /** + * Creates a plain object from a ListOSPolicyAssignmentReportsResponse message. Also converts values to other types if specified. + * @param message ListOSPolicyAssignmentReportsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOSPolicyAssignmentReportsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOSPolicyAssignmentReportsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a OSPolicyAssignmentReport. */ + interface IOSPolicyAssignmentReport { + + /** OSPolicyAssignmentReport name */ + name?: (string|null); + + /** OSPolicyAssignmentReport instance */ + instance?: (string|null); + + /** OSPolicyAssignmentReport osPolicyAssignment */ + osPolicyAssignment?: (string|null); + + /** OSPolicyAssignmentReport osPolicyCompliances */ + osPolicyCompliances?: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.IOSPolicyCompliance[]|null); + + /** OSPolicyAssignmentReport updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** OSPolicyAssignmentReport lastRunId */ + lastRunId?: (string|null); + } + + /** Represents a OSPolicyAssignmentReport. */ + class OSPolicyAssignmentReport implements IOSPolicyAssignmentReport { + + /** + * Constructs a new OSPolicyAssignmentReport. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport); + + /** OSPolicyAssignmentReport name. */ + public name: string; + + /** OSPolicyAssignmentReport instance. */ + public instance: string; + + /** OSPolicyAssignmentReport osPolicyAssignment. */ + public osPolicyAssignment: string; + + /** OSPolicyAssignmentReport osPolicyCompliances. */ + public osPolicyCompliances: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.IOSPolicyCompliance[]; + + /** OSPolicyAssignmentReport updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** OSPolicyAssignmentReport lastRunId. */ + public lastRunId: string; + + /** + * Creates a new OSPolicyAssignmentReport instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyAssignmentReport instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport; + + /** + * Encodes the specified OSPolicyAssignmentReport message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.verify|verify} messages. + * @param message OSPolicyAssignmentReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyAssignmentReport message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.verify|verify} messages. + * @param message OSPolicyAssignmentReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyAssignmentReport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyAssignmentReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport; + + /** + * Decodes a OSPolicyAssignmentReport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyAssignmentReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport; + + /** + * Verifies a OSPolicyAssignmentReport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyAssignmentReport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyAssignmentReport + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport; + + /** + * Creates a plain object from a OSPolicyAssignmentReport message. Also converts values to other types if specified. + * @param message OSPolicyAssignmentReport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyAssignmentReport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyAssignmentReport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyAssignmentReport { + + /** Properties of a OSPolicyCompliance. */ + interface IOSPolicyCompliance { + + /** OSPolicyCompliance osPolicyId */ + osPolicyId?: (string|null); + + /** OSPolicyCompliance complianceState */ + complianceState?: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState|null); + + /** OSPolicyCompliance complianceStateReason */ + complianceStateReason?: (string|null); + + /** OSPolicyCompliance osPolicyResourceCompliances */ + osPolicyResourceCompliances?: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance[]|null); + } + + /** Represents a OSPolicyCompliance. */ + class OSPolicyCompliance implements IOSPolicyCompliance { + + /** + * Constructs a new OSPolicyCompliance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.IOSPolicyCompliance); + + /** OSPolicyCompliance osPolicyId. */ + public osPolicyId: string; + + /** OSPolicyCompliance complianceState. */ + public complianceState: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState); + + /** OSPolicyCompliance complianceStateReason. */ + public complianceStateReason: string; + + /** OSPolicyCompliance osPolicyResourceCompliances. */ + public osPolicyResourceCompliances: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance[]; + + /** + * Creates a new OSPolicyCompliance instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyCompliance instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.IOSPolicyCompliance): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance; + + /** + * Encodes the specified OSPolicyCompliance message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.verify|verify} messages. + * @param message OSPolicyCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.IOSPolicyCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.verify|verify} messages. + * @param message OSPolicyCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.IOSPolicyCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyCompliance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance; + + /** + * Decodes a OSPolicyCompliance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance; + + /** + * Verifies a OSPolicyCompliance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyCompliance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyCompliance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance; + + /** + * Creates a plain object from a OSPolicyCompliance message. Also converts values to other types if specified. + * @param message OSPolicyCompliance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyCompliance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyCompliance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyCompliance { + + /** ComplianceState enum. */ + enum ComplianceState { + UNKNOWN = 0, + COMPLIANT = 1, + NON_COMPLIANT = 2 + } + + /** Properties of a OSPolicyResourceCompliance. */ + interface IOSPolicyResourceCompliance { + + /** OSPolicyResourceCompliance osPolicyResourceId */ + osPolicyResourceId?: (string|null); + + /** OSPolicyResourceCompliance configSteps */ + configSteps?: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep[]|null); + + /** OSPolicyResourceCompliance complianceState */ + complianceState?: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState|null); + + /** OSPolicyResourceCompliance complianceStateReason */ + complianceStateReason?: (string|null); + + /** OSPolicyResourceCompliance execResourceOutput */ + execResourceOutput?: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput|null); + } + + /** Represents a OSPolicyResourceCompliance. */ + class OSPolicyResourceCompliance implements IOSPolicyResourceCompliance { + + /** + * Constructs a new OSPolicyResourceCompliance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance); + + /** OSPolicyResourceCompliance osPolicyResourceId. */ + public osPolicyResourceId: string; + + /** OSPolicyResourceCompliance configSteps. */ + public configSteps: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep[]; + + /** OSPolicyResourceCompliance complianceState. */ + public complianceState: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState); + + /** OSPolicyResourceCompliance complianceStateReason. */ + public complianceStateReason: string; + + /** OSPolicyResourceCompliance execResourceOutput. */ + public execResourceOutput?: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput|null); + + /** OSPolicyResourceCompliance output. */ + public output?: "execResourceOutput"; + + /** + * Creates a new OSPolicyResourceCompliance instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyResourceCompliance instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance; + + /** + * Encodes the specified OSPolicyResourceCompliance message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.verify|verify} messages. + * @param message OSPolicyResourceCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyResourceCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.verify|verify} messages. + * @param message OSPolicyResourceCompliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyResourceCompliance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyResourceCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance; + + /** + * Decodes a OSPolicyResourceCompliance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyResourceCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance; + + /** + * Verifies a OSPolicyResourceCompliance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyResourceCompliance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyResourceCompliance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance; + + /** + * Creates a plain object from a OSPolicyResourceCompliance message. Also converts values to other types if specified. + * @param message OSPolicyResourceCompliance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyResourceCompliance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyResourceCompliance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyResourceCompliance { + + /** Properties of a OSPolicyResourceConfigStep. */ + interface IOSPolicyResourceConfigStep { + + /** OSPolicyResourceConfigStep type */ + type?: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type|null); + + /** OSPolicyResourceConfigStep errorMessage */ + errorMessage?: (string|null); + } + + /** Represents a OSPolicyResourceConfigStep. */ + class OSPolicyResourceConfigStep implements IOSPolicyResourceConfigStep { + + /** + * Constructs a new OSPolicyResourceConfigStep. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep); + + /** OSPolicyResourceConfigStep type. */ + public type: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type); + + /** OSPolicyResourceConfigStep errorMessage. */ + public errorMessage: string; + + /** + * Creates a new OSPolicyResourceConfigStep instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyResourceConfigStep instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep; + + /** + * Encodes the specified OSPolicyResourceConfigStep message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.verify|verify} messages. + * @param message OSPolicyResourceConfigStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyResourceConfigStep message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.verify|verify} messages. + * @param message OSPolicyResourceConfigStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyResourceConfigStep message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyResourceConfigStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep; + + /** + * Decodes a OSPolicyResourceConfigStep message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyResourceConfigStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep; + + /** + * Verifies a OSPolicyResourceConfigStep message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyResourceConfigStep message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyResourceConfigStep + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep; + + /** + * Creates a plain object from a OSPolicyResourceConfigStep message. Also converts values to other types if specified. + * @param message OSPolicyResourceConfigStep + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyResourceConfigStep to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyResourceConfigStep + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyResourceConfigStep { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + VALIDATION = 1, + DESIRED_STATE_CHECK = 2, + DESIRED_STATE_ENFORCEMENT = 3, + DESIRED_STATE_CHECK_POST_ENFORCEMENT = 4 + } + } + + /** ComplianceState enum. */ + enum ComplianceState { + UNKNOWN = 0, + COMPLIANT = 1, + NON_COMPLIANT = 2 + } + + /** Properties of an ExecResourceOutput. */ + interface IExecResourceOutput { + + /** ExecResourceOutput enforcementOutput */ + enforcementOutput?: (Uint8Array|string|null); + } + + /** Represents an ExecResourceOutput. */ + class ExecResourceOutput implements IExecResourceOutput { + + /** + * Constructs a new ExecResourceOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput); + + /** ExecResourceOutput enforcementOutput. */ + public enforcementOutput: (Uint8Array|string); + + /** + * Creates a new ExecResourceOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecResourceOutput instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput; + + /** + * Encodes the specified ExecResourceOutput message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.verify|verify} messages. + * @param message ExecResourceOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecResourceOutput message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.verify|verify} messages. + * @param message ExecResourceOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecResourceOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecResourceOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput; + + /** + * Decodes an ExecResourceOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecResourceOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput; + + /** + * Verifies an ExecResourceOutput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecResourceOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecResourceOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput; + + /** + * Creates a plain object from an ExecResourceOutput message. Also converts values to other types if specified. + * @param message ExecResourceOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecResourceOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecResourceOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Properties of a OSPolicyAssignment. */ + interface IOSPolicyAssignment { + + /** OSPolicyAssignment name */ + name?: (string|null); + + /** OSPolicyAssignment description */ + description?: (string|null); + + /** OSPolicyAssignment osPolicies */ + osPolicies?: (google.cloud.osconfig.v1alpha.IOSPolicy[]|null); + + /** OSPolicyAssignment instanceFilter */ + instanceFilter?: (google.cloud.osconfig.v1alpha.OSPolicyAssignment.IInstanceFilter|null); + + /** OSPolicyAssignment rollout */ + rollout?: (google.cloud.osconfig.v1alpha.OSPolicyAssignment.IRollout|null); + + /** OSPolicyAssignment revisionId */ + revisionId?: (string|null); + + /** OSPolicyAssignment revisionCreateTime */ + revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** OSPolicyAssignment etag */ + etag?: (string|null); + + /** OSPolicyAssignment rolloutState */ + rolloutState?: (google.cloud.osconfig.v1alpha.OSPolicyAssignment.RolloutState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyAssignment.RolloutState|null); + + /** OSPolicyAssignment baseline */ + baseline?: (boolean|null); + + /** OSPolicyAssignment deleted */ + deleted?: (boolean|null); + + /** OSPolicyAssignment reconciling */ + reconciling?: (boolean|null); + + /** OSPolicyAssignment uid */ + uid?: (string|null); + } + + /** Represents a OSPolicyAssignment. */ + class OSPolicyAssignment implements IOSPolicyAssignment { + + /** + * Constructs a new OSPolicyAssignment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IOSPolicyAssignment); + + /** OSPolicyAssignment name. */ + public name: string; + + /** OSPolicyAssignment description. */ + public description: string; + + /** OSPolicyAssignment osPolicies. */ + public osPolicies: google.cloud.osconfig.v1alpha.IOSPolicy[]; + + /** OSPolicyAssignment instanceFilter. */ + public instanceFilter?: (google.cloud.osconfig.v1alpha.OSPolicyAssignment.IInstanceFilter|null); + + /** OSPolicyAssignment rollout. */ + public rollout?: (google.cloud.osconfig.v1alpha.OSPolicyAssignment.IRollout|null); + + /** OSPolicyAssignment revisionId. */ + public revisionId: string; + + /** OSPolicyAssignment revisionCreateTime. */ + public revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** OSPolicyAssignment etag. */ + public etag: string; + + /** OSPolicyAssignment rolloutState. */ + public rolloutState: (google.cloud.osconfig.v1alpha.OSPolicyAssignment.RolloutState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyAssignment.RolloutState); + + /** OSPolicyAssignment baseline. */ + public baseline: boolean; + + /** OSPolicyAssignment deleted. */ + public deleted: boolean; + + /** OSPolicyAssignment reconciling. */ + public reconciling: boolean; + + /** OSPolicyAssignment uid. */ + public uid: string; + + /** + * Creates a new OSPolicyAssignment instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyAssignment instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IOSPolicyAssignment): google.cloud.osconfig.v1alpha.OSPolicyAssignment; + + /** + * Encodes the specified OSPolicyAssignment message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.verify|verify} messages. + * @param message OSPolicyAssignment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IOSPolicyAssignment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyAssignment message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.verify|verify} messages. + * @param message OSPolicyAssignment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IOSPolicyAssignment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyAssignment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyAssignment; + + /** + * Decodes a OSPolicyAssignment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyAssignment; + + /** + * Verifies a OSPolicyAssignment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyAssignment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyAssignment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyAssignment; + + /** + * Creates a plain object from a OSPolicyAssignment message. Also converts values to other types if specified. + * @param message OSPolicyAssignment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyAssignment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyAssignment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyAssignment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyAssignment { + + /** Properties of a LabelSet. */ + interface ILabelSet { + + /** LabelSet labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a LabelSet. */ + class LabelSet implements ILabelSet { + + /** + * Constructs a new LabelSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignment.ILabelSet); + + /** LabelSet labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new LabelSet instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelSet instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignment.ILabelSet): google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet; + + /** + * Encodes the specified LabelSet message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.verify|verify} messages. + * @param message LabelSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicyAssignment.ILabelSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelSet message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.verify|verify} messages. + * @param message LabelSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicyAssignment.ILabelSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet; + + /** + * Decodes a LabelSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet; + + /** + * Verifies a LabelSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet; + + /** + * Creates a plain object from a LabelSet message. Also converts values to other types if specified. + * @param message LabelSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceFilter. */ + interface IInstanceFilter { + + /** InstanceFilter all */ + all?: (boolean|null); + + /** InstanceFilter osShortNames */ + osShortNames?: (string[]|null); + + /** InstanceFilter inclusionLabels */ + inclusionLabels?: (google.cloud.osconfig.v1alpha.OSPolicyAssignment.ILabelSet[]|null); + + /** InstanceFilter exclusionLabels */ + exclusionLabels?: (google.cloud.osconfig.v1alpha.OSPolicyAssignment.ILabelSet[]|null); + + /** InstanceFilter inventories */ + inventories?: (google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.IInventory[]|null); + } + + /** Represents an InstanceFilter. */ + class InstanceFilter implements IInstanceFilter { + + /** + * Constructs a new InstanceFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignment.IInstanceFilter); + + /** InstanceFilter all. */ + public all: boolean; + + /** InstanceFilter osShortNames. */ + public osShortNames: string[]; + + /** InstanceFilter inclusionLabels. */ + public inclusionLabels: google.cloud.osconfig.v1alpha.OSPolicyAssignment.ILabelSet[]; + + /** InstanceFilter exclusionLabels. */ + public exclusionLabels: google.cloud.osconfig.v1alpha.OSPolicyAssignment.ILabelSet[]; + + /** InstanceFilter inventories. */ + public inventories: google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.IInventory[]; + + /** + * Creates a new InstanceFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceFilter instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignment.IInstanceFilter): google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter; + + /** + * Encodes the specified InstanceFilter message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.verify|verify} messages. + * @param message InstanceFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicyAssignment.IInstanceFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceFilter message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.verify|verify} messages. + * @param message InstanceFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicyAssignment.IInstanceFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter; + + /** + * Decodes an InstanceFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter; + + /** + * Verifies an InstanceFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter; + + /** + * Creates a plain object from an InstanceFilter message. Also converts values to other types if specified. + * @param message InstanceFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstanceFilter { + + /** Properties of an Inventory. */ + interface IInventory { + + /** Inventory osShortName */ + osShortName?: (string|null); + + /** Inventory osVersion */ + osVersion?: (string|null); + } + + /** Represents an Inventory. */ + class Inventory implements IInventory { + + /** + * Constructs a new Inventory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.IInventory); + + /** Inventory osShortName. */ + public osShortName: string; + + /** Inventory osVersion. */ + public osVersion: string; + + /** + * Creates a new Inventory instance using the specified properties. + * @param [properties] Properties to set + * @returns Inventory instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.IInventory): google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory; + + /** + * Verifies an Inventory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Inventory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Inventory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @param message Inventory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Inventory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Inventory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Rollout. */ + interface IRollout { + + /** Rollout disruptionBudget */ + disruptionBudget?: (google.cloud.osconfig.v1alpha.IFixedOrPercent|null); + + /** Rollout minWaitDuration */ + minWaitDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a Rollout. */ + class Rollout implements IRollout { + + /** + * Constructs a new Rollout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignment.IRollout); + + /** Rollout disruptionBudget. */ + public disruptionBudget?: (google.cloud.osconfig.v1alpha.IFixedOrPercent|null); + + /** Rollout minWaitDuration. */ + public minWaitDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new Rollout instance using the specified properties. + * @param [properties] Properties to set + * @returns Rollout instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.OSPolicyAssignment.IRollout): google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout; + + /** + * Encodes the specified Rollout message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout.verify|verify} messages. + * @param message Rollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.OSPolicyAssignment.IRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Rollout message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout.verify|verify} messages. + * @param message Rollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.OSPolicyAssignment.IRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rollout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout; + + /** + * Decodes a Rollout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout; + + /** + * Verifies a Rollout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Rollout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rollout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout; + + /** + * Creates a plain object from a Rollout message. Also converts values to other types if specified. + * @param message Rollout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rollout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Rollout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RolloutState enum. */ + enum RolloutState { + ROLLOUT_STATE_UNSPECIFIED = 0, + IN_PROGRESS = 1, + CANCELLING = 2, + CANCELLED = 3, + SUCCEEDED = 4 + } + } + + /** Properties of a OSPolicyAssignmentOperationMetadata. */ + interface IOSPolicyAssignmentOperationMetadata { + + /** OSPolicyAssignmentOperationMetadata osPolicyAssignment */ + osPolicyAssignment?: (string|null); + + /** OSPolicyAssignmentOperationMetadata apiMethod */ + apiMethod?: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.APIMethod|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.APIMethod|null); + + /** OSPolicyAssignmentOperationMetadata rolloutState */ + rolloutState?: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.RolloutState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.RolloutState|null); + + /** OSPolicyAssignmentOperationMetadata rolloutStartTime */ + rolloutStartTime?: (google.protobuf.ITimestamp|null); + + /** OSPolicyAssignmentOperationMetadata rolloutUpdateTime */ + rolloutUpdateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a OSPolicyAssignmentOperationMetadata. */ + class OSPolicyAssignmentOperationMetadata implements IOSPolicyAssignmentOperationMetadata { + + /** + * Constructs a new OSPolicyAssignmentOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata); + + /** OSPolicyAssignmentOperationMetadata osPolicyAssignment. */ + public osPolicyAssignment: string; + + /** OSPolicyAssignmentOperationMetadata apiMethod. */ + public apiMethod: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.APIMethod|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.APIMethod); + + /** OSPolicyAssignmentOperationMetadata rolloutState. */ + public rolloutState: (google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.RolloutState|keyof typeof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.RolloutState); + + /** OSPolicyAssignmentOperationMetadata rolloutStartTime. */ + public rolloutStartTime?: (google.protobuf.ITimestamp|null); + + /** OSPolicyAssignmentOperationMetadata rolloutUpdateTime. */ + public rolloutUpdateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OSPolicyAssignmentOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OSPolicyAssignmentOperationMetadata instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata): google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata; + + /** + * Encodes the specified OSPolicyAssignmentOperationMetadata message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.verify|verify} messages. + * @param message OSPolicyAssignmentOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OSPolicyAssignmentOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.verify|verify} messages. + * @param message OSPolicyAssignmentOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OSPolicyAssignmentOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OSPolicyAssignmentOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata; + + /** + * Decodes a OSPolicyAssignmentOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OSPolicyAssignmentOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata; + + /** + * Verifies a OSPolicyAssignmentOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OSPolicyAssignmentOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OSPolicyAssignmentOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata; + + /** + * Creates a plain object from a OSPolicyAssignmentOperationMetadata message. Also converts values to other types if specified. + * @param message OSPolicyAssignmentOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OSPolicyAssignmentOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OSPolicyAssignmentOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OSPolicyAssignmentOperationMetadata { + + /** APIMethod enum. */ + enum APIMethod { + API_METHOD_UNSPECIFIED = 0, + CREATE = 1, + UPDATE = 2, + DELETE = 3 + } + + /** RolloutState enum. */ + enum RolloutState { + ROLLOUT_STATE_UNSPECIFIED = 0, + IN_PROGRESS = 1, + CANCELLING = 2, + CANCELLED = 3, + SUCCEEDED = 4 + } + } + + /** Properties of a CreateOSPolicyAssignmentRequest. */ + interface ICreateOSPolicyAssignmentRequest { + + /** CreateOSPolicyAssignmentRequest parent */ + parent?: (string|null); + + /** CreateOSPolicyAssignmentRequest osPolicyAssignment */ + osPolicyAssignment?: (google.cloud.osconfig.v1alpha.IOSPolicyAssignment|null); + + /** CreateOSPolicyAssignmentRequest osPolicyAssignmentId */ + osPolicyAssignmentId?: (string|null); + } + + /** Represents a CreateOSPolicyAssignmentRequest. */ + class CreateOSPolicyAssignmentRequest implements ICreateOSPolicyAssignmentRequest { + + /** + * Constructs a new CreateOSPolicyAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest); + + /** CreateOSPolicyAssignmentRequest parent. */ + public parent: string; + + /** CreateOSPolicyAssignmentRequest osPolicyAssignment. */ + public osPolicyAssignment?: (google.cloud.osconfig.v1alpha.IOSPolicyAssignment|null); + + /** CreateOSPolicyAssignmentRequest osPolicyAssignmentId. */ + public osPolicyAssignmentId: string; + + /** + * Creates a new CreateOSPolicyAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateOSPolicyAssignmentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest): google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest; + + /** + * Encodes the specified CreateOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest.verify|verify} messages. + * @param message CreateOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest.verify|verify} messages. + * @param message CreateOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateOSPolicyAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest; + + /** + * Decodes a CreateOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest; + + /** + * Verifies a CreateOSPolicyAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateOSPolicyAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest; + + /** + * Creates a plain object from a CreateOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @param message CreateOSPolicyAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateOSPolicyAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateOSPolicyAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateOSPolicyAssignmentRequest. */ + interface IUpdateOSPolicyAssignmentRequest { + + /** UpdateOSPolicyAssignmentRequest osPolicyAssignment */ + osPolicyAssignment?: (google.cloud.osconfig.v1alpha.IOSPolicyAssignment|null); + + /** UpdateOSPolicyAssignmentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateOSPolicyAssignmentRequest. */ + class UpdateOSPolicyAssignmentRequest implements IUpdateOSPolicyAssignmentRequest { + + /** + * Constructs a new UpdateOSPolicyAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest); + + /** UpdateOSPolicyAssignmentRequest osPolicyAssignment. */ + public osPolicyAssignment?: (google.cloud.osconfig.v1alpha.IOSPolicyAssignment|null); + + /** UpdateOSPolicyAssignmentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateOSPolicyAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOSPolicyAssignmentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest): google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest; + + /** + * Encodes the specified UpdateOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest.verify|verify} messages. + * @param message UpdateOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest.verify|verify} messages. + * @param message UpdateOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateOSPolicyAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest; + + /** + * Decodes an UpdateOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest; + + /** + * Verifies an UpdateOSPolicyAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOSPolicyAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest; + + /** + * Creates a plain object from an UpdateOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @param message UpdateOSPolicyAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOSPolicyAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateOSPolicyAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOSPolicyAssignmentRequest. */ + interface IGetOSPolicyAssignmentRequest { + + /** GetOSPolicyAssignmentRequest name */ + name?: (string|null); + } + + /** Represents a GetOSPolicyAssignmentRequest. */ + class GetOSPolicyAssignmentRequest implements IGetOSPolicyAssignmentRequest { + + /** + * Constructs a new GetOSPolicyAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest); + + /** GetOSPolicyAssignmentRequest name. */ + public name: string; + + /** + * Creates a new GetOSPolicyAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOSPolicyAssignmentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest): google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest; + + /** + * Encodes the specified GetOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest.verify|verify} messages. + * @param message GetOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest.verify|verify} messages. + * @param message GetOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOSPolicyAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest; + + /** + * Decodes a GetOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest; + + /** + * Verifies a GetOSPolicyAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOSPolicyAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest; + + /** + * Creates a plain object from a GetOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @param message GetOSPolicyAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOSPolicyAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOSPolicyAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOSPolicyAssignmentsRequest. */ + interface IListOSPolicyAssignmentsRequest { + + /** ListOSPolicyAssignmentsRequest parent */ + parent?: (string|null); + + /** ListOSPolicyAssignmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListOSPolicyAssignmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOSPolicyAssignmentsRequest. */ + class ListOSPolicyAssignmentsRequest implements IListOSPolicyAssignmentsRequest { + + /** + * Constructs a new ListOSPolicyAssignmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest); + + /** ListOSPolicyAssignmentsRequest parent. */ + public parent: string; + + /** ListOSPolicyAssignmentsRequest pageSize. */ + public pageSize: number; + + /** ListOSPolicyAssignmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOSPolicyAssignmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOSPolicyAssignmentsRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest; + + /** + * Encodes the specified ListOSPolicyAssignmentsRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest.verify|verify} messages. + * @param message ListOSPolicyAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOSPolicyAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest.verify|verify} messages. + * @param message ListOSPolicyAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOSPolicyAssignmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOSPolicyAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest; + + /** + * Decodes a ListOSPolicyAssignmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOSPolicyAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest; + + /** + * Verifies a ListOSPolicyAssignmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOSPolicyAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOSPolicyAssignmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest; + + /** + * Creates a plain object from a ListOSPolicyAssignmentsRequest message. Also converts values to other types if specified. + * @param message ListOSPolicyAssignmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOSPolicyAssignmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOSPolicyAssignmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOSPolicyAssignmentsResponse. */ + interface IListOSPolicyAssignmentsResponse { + + /** ListOSPolicyAssignmentsResponse osPolicyAssignments */ + osPolicyAssignments?: (google.cloud.osconfig.v1alpha.IOSPolicyAssignment[]|null); + + /** ListOSPolicyAssignmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOSPolicyAssignmentsResponse. */ + class ListOSPolicyAssignmentsResponse implements IListOSPolicyAssignmentsResponse { + + /** + * Constructs a new ListOSPolicyAssignmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse); + + /** ListOSPolicyAssignmentsResponse osPolicyAssignments. */ + public osPolicyAssignments: google.cloud.osconfig.v1alpha.IOSPolicyAssignment[]; + + /** ListOSPolicyAssignmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOSPolicyAssignmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOSPolicyAssignmentsResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse; + + /** + * Encodes the specified ListOSPolicyAssignmentsResponse message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse.verify|verify} messages. + * @param message ListOSPolicyAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOSPolicyAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse.verify|verify} messages. + * @param message ListOSPolicyAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOSPolicyAssignmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOSPolicyAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse; + + /** + * Decodes a ListOSPolicyAssignmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOSPolicyAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse; + + /** + * Verifies a ListOSPolicyAssignmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOSPolicyAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOSPolicyAssignmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse; + + /** + * Creates a plain object from a ListOSPolicyAssignmentsResponse message. Also converts values to other types if specified. + * @param message ListOSPolicyAssignmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOSPolicyAssignmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOSPolicyAssignmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOSPolicyAssignmentRevisionsRequest. */ + interface IListOSPolicyAssignmentRevisionsRequest { + + /** ListOSPolicyAssignmentRevisionsRequest name */ + name?: (string|null); + + /** ListOSPolicyAssignmentRevisionsRequest pageSize */ + pageSize?: (number|null); + + /** ListOSPolicyAssignmentRevisionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOSPolicyAssignmentRevisionsRequest. */ + class ListOSPolicyAssignmentRevisionsRequest implements IListOSPolicyAssignmentRevisionsRequest { + + /** + * Constructs a new ListOSPolicyAssignmentRevisionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest); + + /** ListOSPolicyAssignmentRevisionsRequest name. */ + public name: string; + + /** ListOSPolicyAssignmentRevisionsRequest pageSize. */ + public pageSize: number; + + /** ListOSPolicyAssignmentRevisionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOSPolicyAssignmentRevisionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOSPolicyAssignmentRevisionsRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest.verify|verify} messages. + * @param message ListOSPolicyAssignmentRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest.verify|verify} messages. + * @param message ListOSPolicyAssignmentRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOSPolicyAssignmentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOSPolicyAssignmentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest; + + /** + * Verifies a ListOSPolicyAssignmentRevisionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOSPolicyAssignmentRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOSPolicyAssignmentRevisionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest; + + /** + * Creates a plain object from a ListOSPolicyAssignmentRevisionsRequest message. Also converts values to other types if specified. + * @param message ListOSPolicyAssignmentRevisionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOSPolicyAssignmentRevisionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOSPolicyAssignmentRevisionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOSPolicyAssignmentRevisionsResponse. */ + interface IListOSPolicyAssignmentRevisionsResponse { + + /** ListOSPolicyAssignmentRevisionsResponse osPolicyAssignments */ + osPolicyAssignments?: (google.cloud.osconfig.v1alpha.IOSPolicyAssignment[]|null); + + /** ListOSPolicyAssignmentRevisionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOSPolicyAssignmentRevisionsResponse. */ + class ListOSPolicyAssignmentRevisionsResponse implements IListOSPolicyAssignmentRevisionsResponse { + + /** + * Constructs a new ListOSPolicyAssignmentRevisionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse); + + /** ListOSPolicyAssignmentRevisionsResponse osPolicyAssignments. */ + public osPolicyAssignments: google.cloud.osconfig.v1alpha.IOSPolicyAssignment[]; + + /** ListOSPolicyAssignmentRevisionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOSPolicyAssignmentRevisionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOSPolicyAssignmentRevisionsResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsResponse message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse.verify|verify} messages. + * @param message ListOSPolicyAssignmentRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse.verify|verify} messages. + * @param message ListOSPolicyAssignmentRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOSPolicyAssignmentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOSPolicyAssignmentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse; + + /** + * Verifies a ListOSPolicyAssignmentRevisionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOSPolicyAssignmentRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOSPolicyAssignmentRevisionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse; + + /** + * Creates a plain object from a ListOSPolicyAssignmentRevisionsResponse message. Also converts values to other types if specified. + * @param message ListOSPolicyAssignmentRevisionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOSPolicyAssignmentRevisionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOSPolicyAssignmentRevisionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOSPolicyAssignmentRequest. */ + interface IDeleteOSPolicyAssignmentRequest { + + /** DeleteOSPolicyAssignmentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOSPolicyAssignmentRequest. */ + class DeleteOSPolicyAssignmentRequest implements IDeleteOSPolicyAssignmentRequest { + + /** + * Constructs a new DeleteOSPolicyAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest); + + /** DeleteOSPolicyAssignmentRequest name. */ + public name: string; + + /** + * Creates a new DeleteOSPolicyAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOSPolicyAssignmentRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest): google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest; + + /** + * Encodes the specified DeleteOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest.verify|verify} messages. + * @param message DeleteOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest.verify|verify} messages. + * @param message DeleteOSPolicyAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOSPolicyAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest; + + /** + * Decodes a DeleteOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest; + + /** + * Verifies a DeleteOSPolicyAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOSPolicyAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest; + + /** + * Creates a plain object from a DeleteOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @param message DeleteOSPolicyAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOSPolicyAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOSPolicyAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedOrPercent. */ + interface IFixedOrPercent { + + /** FixedOrPercent fixed */ + fixed?: (number|null); + + /** FixedOrPercent percent */ + percent?: (number|null); + } + + /** Represents a FixedOrPercent. */ + class FixedOrPercent implements IFixedOrPercent { + + /** + * Constructs a new FixedOrPercent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IFixedOrPercent); + + /** FixedOrPercent fixed. */ + public fixed?: (number|null); + + /** FixedOrPercent percent. */ + public percent?: (number|null); + + /** FixedOrPercent mode. */ + public mode?: ("fixed"|"percent"); + + /** + * Creates a new FixedOrPercent instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedOrPercent instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IFixedOrPercent): google.cloud.osconfig.v1alpha.FixedOrPercent; + + /** + * Encodes the specified FixedOrPercent message. Does not implicitly {@link google.cloud.osconfig.v1alpha.FixedOrPercent.verify|verify} messages. + * @param message FixedOrPercent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IFixedOrPercent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FixedOrPercent message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.FixedOrPercent.verify|verify} messages. + * @param message FixedOrPercent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IFixedOrPercent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedOrPercent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FixedOrPercent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.FixedOrPercent; + + /** + * Decodes a FixedOrPercent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FixedOrPercent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.FixedOrPercent; + + /** + * Verifies a FixedOrPercent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FixedOrPercent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FixedOrPercent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.FixedOrPercent; + + /** + * Creates a plain object from a FixedOrPercent message. Also converts values to other types if specified. + * @param message FixedOrPercent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.FixedOrPercent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FixedOrPercent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FixedOrPercent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an OsConfigZonalService */ + class OsConfigZonalService extends $protobuf.rpc.Service { + + /** + * Constructs a new OsConfigZonalService 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 OsConfigZonalService 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): OsConfigZonalService; + + /** + * Calls CreateOSPolicyAssignment. + * @param request CreateOSPolicyAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createOSPolicyAssignment(request: google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.CreateOSPolicyAssignmentCallback): void; + + /** + * Calls CreateOSPolicyAssignment. + * @param request CreateOSPolicyAssignmentRequest message or plain object + * @returns Promise + */ + public createOSPolicyAssignment(request: google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest): Promise; + + /** + * Calls UpdateOSPolicyAssignment. + * @param request UpdateOSPolicyAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateOSPolicyAssignment(request: google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.UpdateOSPolicyAssignmentCallback): void; + + /** + * Calls UpdateOSPolicyAssignment. + * @param request UpdateOSPolicyAssignmentRequest message or plain object + * @returns Promise + */ + public updateOSPolicyAssignment(request: google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest): Promise; + + /** + * Calls GetOSPolicyAssignment. + * @param request GetOSPolicyAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OSPolicyAssignment + */ + public getOSPolicyAssignment(request: google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.GetOSPolicyAssignmentCallback): void; + + /** + * Calls GetOSPolicyAssignment. + * @param request GetOSPolicyAssignmentRequest message or plain object + * @returns Promise + */ + public getOSPolicyAssignment(request: google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest): Promise; + + /** + * Calls ListOSPolicyAssignments. + * @param request ListOSPolicyAssignmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOSPolicyAssignmentsResponse + */ + public listOSPolicyAssignments(request: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.ListOSPolicyAssignmentsCallback): void; + + /** + * Calls ListOSPolicyAssignments. + * @param request ListOSPolicyAssignmentsRequest message or plain object + * @returns Promise + */ + public listOSPolicyAssignments(request: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest): Promise; + + /** + * Calls ListOSPolicyAssignmentRevisions. + * @param request ListOSPolicyAssignmentRevisionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOSPolicyAssignmentRevisionsResponse + */ + public listOSPolicyAssignmentRevisions(request: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.ListOSPolicyAssignmentRevisionsCallback): void; + + /** + * Calls ListOSPolicyAssignmentRevisions. + * @param request ListOSPolicyAssignmentRevisionsRequest message or plain object + * @returns Promise + */ + public listOSPolicyAssignmentRevisions(request: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest): Promise; + + /** + * Calls DeleteOSPolicyAssignment. + * @param request DeleteOSPolicyAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteOSPolicyAssignment(request: google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.DeleteOSPolicyAssignmentCallback): void; + + /** + * Calls DeleteOSPolicyAssignment. + * @param request DeleteOSPolicyAssignmentRequest message or plain object + * @returns Promise + */ + public deleteOSPolicyAssignment(request: google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest): Promise; + + /** + * Calls GetInstanceOSPoliciesCompliance. + * @param request GetInstanceOSPoliciesComplianceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceOSPoliciesCompliance + */ + public getInstanceOSPoliciesCompliance(request: google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.GetInstanceOSPoliciesComplianceCallback): void; + + /** + * Calls GetInstanceOSPoliciesCompliance. + * @param request GetInstanceOSPoliciesComplianceRequest message or plain object + * @returns Promise + */ + public getInstanceOSPoliciesCompliance(request: google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest): Promise; + + /** + * Calls ListInstanceOSPoliciesCompliances. + * @param request ListInstanceOSPoliciesCompliancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstanceOSPoliciesCompliancesResponse + */ + public listInstanceOSPoliciesCompliances(request: google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.ListInstanceOSPoliciesCompliancesCallback): void; + + /** + * Calls ListInstanceOSPoliciesCompliances. + * @param request ListInstanceOSPoliciesCompliancesRequest message or plain object + * @returns Promise + */ + public listInstanceOSPoliciesCompliances(request: google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest): Promise; + + /** + * Calls GetOSPolicyAssignmentReport. + * @param request GetOSPolicyAssignmentReportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OSPolicyAssignmentReport + */ + public getOSPolicyAssignmentReport(request: google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.GetOSPolicyAssignmentReportCallback): void; + + /** + * Calls GetOSPolicyAssignmentReport. + * @param request GetOSPolicyAssignmentReportRequest message or plain object + * @returns Promise + */ + public getOSPolicyAssignmentReport(request: google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest): Promise; + + /** + * Calls ListOSPolicyAssignmentReports. + * @param request ListOSPolicyAssignmentReportsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOSPolicyAssignmentReportsResponse + */ + public listOSPolicyAssignmentReports(request: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.ListOSPolicyAssignmentReportsCallback): void; + + /** + * Calls ListOSPolicyAssignmentReports. + * @param request ListOSPolicyAssignmentReportsRequest message or plain object + * @returns Promise + */ + public listOSPolicyAssignmentReports(request: google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest): Promise; + + /** + * Calls GetInventory. + * @param request GetInventoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Inventory + */ + public getInventory(request: google.cloud.osconfig.v1alpha.IGetInventoryRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.GetInventoryCallback): void; + + /** + * Calls GetInventory. + * @param request GetInventoryRequest message or plain object + * @returns Promise + */ + public getInventory(request: google.cloud.osconfig.v1alpha.IGetInventoryRequest): Promise; + + /** + * Calls ListInventories. + * @param request ListInventoriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInventoriesResponse + */ + public listInventories(request: google.cloud.osconfig.v1alpha.IListInventoriesRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.ListInventoriesCallback): void; + + /** + * Calls ListInventories. + * @param request ListInventoriesRequest message or plain object + * @returns Promise + */ + public listInventories(request: google.cloud.osconfig.v1alpha.IListInventoriesRequest): Promise; + + /** + * Calls GetVulnerabilityReport. + * @param request GetVulnerabilityReportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VulnerabilityReport + */ + public getVulnerabilityReport(request: google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.GetVulnerabilityReportCallback): void; + + /** + * Calls GetVulnerabilityReport. + * @param request GetVulnerabilityReportRequest message or plain object + * @returns Promise + */ + public getVulnerabilityReport(request: google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest): Promise; + + /** + * Calls ListVulnerabilityReports. + * @param request ListVulnerabilityReportsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListVulnerabilityReportsResponse + */ + public listVulnerabilityReports(request: google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest, callback: google.cloud.osconfig.v1alpha.OsConfigZonalService.ListVulnerabilityReportsCallback): void; + + /** + * Calls ListVulnerabilityReports. + * @param request ListVulnerabilityReportsRequest message or plain object + * @returns Promise + */ + public listVulnerabilityReports(request: google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest): Promise; + } + + namespace OsConfigZonalService { + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|createOSPolicyAssignment}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateOSPolicyAssignmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|updateOSPolicyAssignment}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateOSPolicyAssignmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|getOSPolicyAssignment}. + * @param error Error, if any + * @param [response] OSPolicyAssignment + */ + type GetOSPolicyAssignmentCallback = (error: (Error|null), response?: google.cloud.osconfig.v1alpha.OSPolicyAssignment) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|listOSPolicyAssignments}. + * @param error Error, if any + * @param [response] ListOSPolicyAssignmentsResponse + */ + type ListOSPolicyAssignmentsCallback = (error: (Error|null), response?: google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|listOSPolicyAssignmentRevisions}. + * @param error Error, if any + * @param [response] ListOSPolicyAssignmentRevisionsResponse + */ + type ListOSPolicyAssignmentRevisionsCallback = (error: (Error|null), response?: google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|deleteOSPolicyAssignment}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteOSPolicyAssignmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|getInstanceOSPoliciesCompliance}. + * @param error Error, if any + * @param [response] InstanceOSPoliciesCompliance + */ + type GetInstanceOSPoliciesComplianceCallback = (error: (Error|null), response?: google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|listInstanceOSPoliciesCompliances}. + * @param error Error, if any + * @param [response] ListInstanceOSPoliciesCompliancesResponse + */ + type ListInstanceOSPoliciesCompliancesCallback = (error: (Error|null), response?: google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|getOSPolicyAssignmentReport}. + * @param error Error, if any + * @param [response] OSPolicyAssignmentReport + */ + type GetOSPolicyAssignmentReportCallback = (error: (Error|null), response?: google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|listOSPolicyAssignmentReports}. + * @param error Error, if any + * @param [response] ListOSPolicyAssignmentReportsResponse + */ + type ListOSPolicyAssignmentReportsCallback = (error: (Error|null), response?: google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|getInventory}. + * @param error Error, if any + * @param [response] Inventory + */ + type GetInventoryCallback = (error: (Error|null), response?: google.cloud.osconfig.v1alpha.Inventory) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|listInventories}. + * @param error Error, if any + * @param [response] ListInventoriesResponse + */ + type ListInventoriesCallback = (error: (Error|null), response?: google.cloud.osconfig.v1alpha.ListInventoriesResponse) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|getVulnerabilityReport}. + * @param error Error, if any + * @param [response] VulnerabilityReport + */ + type GetVulnerabilityReportCallback = (error: (Error|null), response?: google.cloud.osconfig.v1alpha.VulnerabilityReport) => void; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|listVulnerabilityReports}. + * @param error Error, if any + * @param [response] ListVulnerabilityReportsResponse + */ + type ListVulnerabilityReportsCallback = (error: (Error|null), response?: google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse) => void; + } + + /** Properties of a VulnerabilityReport. */ + interface IVulnerabilityReport { + + /** VulnerabilityReport name */ + name?: (string|null); + + /** VulnerabilityReport vulnerabilities */ + vulnerabilities?: (google.cloud.osconfig.v1alpha.VulnerabilityReport.IVulnerability[]|null); + + /** VulnerabilityReport updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a VulnerabilityReport. */ + class VulnerabilityReport implements IVulnerabilityReport { + + /** + * Constructs a new VulnerabilityReport. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IVulnerabilityReport); + + /** VulnerabilityReport name. */ + public name: string; + + /** VulnerabilityReport vulnerabilities. */ + public vulnerabilities: google.cloud.osconfig.v1alpha.VulnerabilityReport.IVulnerability[]; + + /** VulnerabilityReport updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new VulnerabilityReport instance using the specified properties. + * @param [properties] Properties to set + * @returns VulnerabilityReport instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IVulnerabilityReport): google.cloud.osconfig.v1alpha.VulnerabilityReport; + + /** + * Encodes the specified VulnerabilityReport message. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.verify|verify} messages. + * @param message VulnerabilityReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IVulnerabilityReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VulnerabilityReport message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.verify|verify} messages. + * @param message VulnerabilityReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IVulnerabilityReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VulnerabilityReport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VulnerabilityReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.VulnerabilityReport; + + /** + * Decodes a VulnerabilityReport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VulnerabilityReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.VulnerabilityReport; + + /** + * Verifies a VulnerabilityReport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VulnerabilityReport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VulnerabilityReport + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.VulnerabilityReport; + + /** + * Creates a plain object from a VulnerabilityReport message. Also converts values to other types if specified. + * @param message VulnerabilityReport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.VulnerabilityReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VulnerabilityReport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VulnerabilityReport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VulnerabilityReport { + + /** Properties of a Vulnerability. */ + interface IVulnerability { + + /** Vulnerability details */ + details?: (google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IDetails|null); + + /** Vulnerability installedInventoryItemIds */ + installedInventoryItemIds?: (string[]|null); + + /** Vulnerability availableInventoryItemIds */ + availableInventoryItemIds?: (string[]|null); + + /** Vulnerability createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Vulnerability updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Vulnerability items */ + items?: (google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IItem[]|null); + } + + /** Represents a Vulnerability. */ + class Vulnerability implements IVulnerability { + + /** + * Constructs a new Vulnerability. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.VulnerabilityReport.IVulnerability); + + /** Vulnerability details. */ + public details?: (google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IDetails|null); + + /** Vulnerability installedInventoryItemIds. */ + public installedInventoryItemIds: string[]; + + /** Vulnerability availableInventoryItemIds. */ + public availableInventoryItemIds: string[]; + + /** Vulnerability createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Vulnerability updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Vulnerability items. */ + public items: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IItem[]; + + /** + * Creates a new Vulnerability instance using the specified properties. + * @param [properties] Properties to set + * @returns Vulnerability instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.VulnerabilityReport.IVulnerability): google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability; + + /** + * Encodes the specified Vulnerability message. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.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.osconfig.v1alpha.VulnerabilityReport.IVulnerability, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vulnerability message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.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.osconfig.v1alpha.VulnerabilityReport.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.osconfig.v1alpha.VulnerabilityReport.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.osconfig.v1alpha.VulnerabilityReport.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.osconfig.v1alpha.VulnerabilityReport.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.osconfig.v1alpha.VulnerabilityReport.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; + } + + namespace Vulnerability { + + /** Properties of a Details. */ + interface IDetails { + + /** Details cve */ + cve?: (string|null); + + /** Details cvssV2Score */ + cvssV2Score?: (number|null); + + /** Details cvssV3 */ + cvssV3?: (google.cloud.osconfig.v1alpha.ICVSSv3|null); + + /** Details severity */ + severity?: (string|null); + + /** Details description */ + description?: (string|null); + + /** Details references */ + references?: (google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.IReference[]|null); + } + + /** Represents a Details. */ + class Details implements IDetails { + + /** + * Constructs a new Details. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IDetails); + + /** Details cve. */ + public cve: string; + + /** Details cvssV2Score. */ + public cvssV2Score: number; + + /** Details cvssV3. */ + public cvssV3?: (google.cloud.osconfig.v1alpha.ICVSSv3|null); + + /** Details severity. */ + public severity: string; + + /** Details description. */ + public description: string; + + /** Details references. */ + public references: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.IReference[]; + + /** + * Creates a new Details instance using the specified properties. + * @param [properties] Properties to set + * @returns Details instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IDetails): google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details; + + /** + * Encodes the specified Details message. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.verify|verify} messages. + * @param message Details message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Details message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.verify|verify} messages. + * @param message Details message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Details message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details; + + /** + * Decodes a Details message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details; + + /** + * Verifies a Details message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Details message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Details + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details; + + /** + * Creates a plain object from a Details message. Also converts values to other types if specified. + * @param message Details + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Details to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Details + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Details { + + /** Properties of a Reference. */ + interface IReference { + + /** Reference url */ + url?: (string|null); + + /** Reference source */ + source?: (string|null); + } + + /** Represents a Reference. */ + class Reference implements IReference { + + /** + * Constructs a new Reference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.IReference); + + /** Reference url. */ + public url: string; + + /** Reference source. */ + public source: string; + + /** + * Creates a new Reference instance using the specified properties. + * @param [properties] Properties to set + * @returns Reference instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.IReference): google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference; + + /** + * Encodes the specified Reference message. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.IReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Reference message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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 an Item. */ + interface IItem { + + /** Item installedInventoryItemId */ + installedInventoryItemId?: (string|null); + + /** Item availableInventoryItemId */ + availableInventoryItemId?: (string|null); + + /** Item fixedCpeUri */ + fixedCpeUri?: (string|null); + + /** Item upstreamFix */ + upstreamFix?: (string|null); + } + + /** Represents an Item. */ + class Item implements IItem { + + /** + * Constructs a new Item. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IItem); + + /** Item installedInventoryItemId. */ + public installedInventoryItemId: string; + + /** Item availableInventoryItemId. */ + public availableInventoryItemId: string; + + /** Item fixedCpeUri. */ + public fixedCpeUri: string; + + /** Item upstreamFix. */ + public upstreamFix: string; + + /** + * Creates a new Item instance using the specified properties. + * @param [properties] Properties to set + * @returns Item instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IItem): google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Item message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item; + + /** + * Verifies an Item message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Item + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @param message Item + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Item to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Item + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a GetVulnerabilityReportRequest. */ + interface IGetVulnerabilityReportRequest { + + /** GetVulnerabilityReportRequest name */ + name?: (string|null); + } + + /** Represents a GetVulnerabilityReportRequest. */ + class GetVulnerabilityReportRequest implements IGetVulnerabilityReportRequest { + + /** + * Constructs a new GetVulnerabilityReportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest); + + /** GetVulnerabilityReportRequest name. */ + public name: string; + + /** + * Creates a new GetVulnerabilityReportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetVulnerabilityReportRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest): google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest; + + /** + * Encodes the specified GetVulnerabilityReportRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest.verify|verify} messages. + * @param message GetVulnerabilityReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetVulnerabilityReportRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest.verify|verify} messages. + * @param message GetVulnerabilityReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetVulnerabilityReportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetVulnerabilityReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest; + + /** + * Decodes a GetVulnerabilityReportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetVulnerabilityReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest; + + /** + * Verifies a GetVulnerabilityReportRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetVulnerabilityReportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetVulnerabilityReportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest; + + /** + * Creates a plain object from a GetVulnerabilityReportRequest message. Also converts values to other types if specified. + * @param message GetVulnerabilityReportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetVulnerabilityReportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetVulnerabilityReportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVulnerabilityReportsRequest. */ + interface IListVulnerabilityReportsRequest { + + /** ListVulnerabilityReportsRequest parent */ + parent?: (string|null); + + /** ListVulnerabilityReportsRequest pageSize */ + pageSize?: (number|null); + + /** ListVulnerabilityReportsRequest pageToken */ + pageToken?: (string|null); + + /** ListVulnerabilityReportsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListVulnerabilityReportsRequest. */ + class ListVulnerabilityReportsRequest implements IListVulnerabilityReportsRequest { + + /** + * Constructs a new ListVulnerabilityReportsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest); + + /** ListVulnerabilityReportsRequest parent. */ + public parent: string; + + /** ListVulnerabilityReportsRequest pageSize. */ + public pageSize: number; + + /** ListVulnerabilityReportsRequest pageToken. */ + public pageToken: string; + + /** ListVulnerabilityReportsRequest filter. */ + public filter: string; + + /** + * Creates a new ListVulnerabilityReportsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVulnerabilityReportsRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest): google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest; + + /** + * Encodes the specified ListVulnerabilityReportsRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest.verify|verify} messages. + * @param message ListVulnerabilityReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVulnerabilityReportsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest.verify|verify} messages. + * @param message ListVulnerabilityReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVulnerabilityReportsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVulnerabilityReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest; + + /** + * Decodes a ListVulnerabilityReportsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVulnerabilityReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest; + + /** + * Verifies a ListVulnerabilityReportsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVulnerabilityReportsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVulnerabilityReportsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest; + + /** + * Creates a plain object from a ListVulnerabilityReportsRequest message. Also converts values to other types if specified. + * @param message ListVulnerabilityReportsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVulnerabilityReportsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVulnerabilityReportsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVulnerabilityReportsResponse. */ + interface IListVulnerabilityReportsResponse { + + /** ListVulnerabilityReportsResponse vulnerabilityReports */ + vulnerabilityReports?: (google.cloud.osconfig.v1alpha.IVulnerabilityReport[]|null); + + /** ListVulnerabilityReportsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListVulnerabilityReportsResponse. */ + class ListVulnerabilityReportsResponse implements IListVulnerabilityReportsResponse { + + /** + * Constructs a new ListVulnerabilityReportsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse); + + /** ListVulnerabilityReportsResponse vulnerabilityReports. */ + public vulnerabilityReports: google.cloud.osconfig.v1alpha.IVulnerabilityReport[]; + + /** ListVulnerabilityReportsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListVulnerabilityReportsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVulnerabilityReportsResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse): google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse; + + /** + * Encodes the specified ListVulnerabilityReportsResponse message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse.verify|verify} messages. + * @param message ListVulnerabilityReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVulnerabilityReportsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse.verify|verify} messages. + * @param message ListVulnerabilityReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVulnerabilityReportsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVulnerabilityReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse; + + /** + * Decodes a ListVulnerabilityReportsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVulnerabilityReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse; + + /** + * Verifies a ListVulnerabilityReportsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVulnerabilityReportsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVulnerabilityReportsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse; + + /** + * Creates a plain object from a ListVulnerabilityReportsResponse message. Also converts values to other types if specified. + * @param message ListVulnerabilityReportsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVulnerabilityReportsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVulnerabilityReportsResponse + * @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 exploitabilityScore */ + exploitabilityScore?: (number|null); + + /** CVSSv3 impactScore */ + impactScore?: (number|null); + + /** CVSSv3 attackVector */ + attackVector?: (google.cloud.osconfig.v1alpha.CVSSv3.AttackVector|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.AttackVector|null); + + /** CVSSv3 attackComplexity */ + attackComplexity?: (google.cloud.osconfig.v1alpha.CVSSv3.AttackComplexity|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.AttackComplexity|null); + + /** CVSSv3 privilegesRequired */ + privilegesRequired?: (google.cloud.osconfig.v1alpha.CVSSv3.PrivilegesRequired|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.PrivilegesRequired|null); + + /** CVSSv3 userInteraction */ + userInteraction?: (google.cloud.osconfig.v1alpha.CVSSv3.UserInteraction|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.UserInteraction|null); + + /** CVSSv3 scope */ + scope?: (google.cloud.osconfig.v1alpha.CVSSv3.Scope|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.Scope|null); + + /** CVSSv3 confidentialityImpact */ + confidentialityImpact?: (google.cloud.osconfig.v1alpha.CVSSv3.Impact|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.Impact|null); + + /** CVSSv3 integrityImpact */ + integrityImpact?: (google.cloud.osconfig.v1alpha.CVSSv3.Impact|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.Impact|null); + + /** CVSSv3 availabilityImpact */ + availabilityImpact?: (google.cloud.osconfig.v1alpha.CVSSv3.Impact|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.Impact|null); + } + + /** Represents a CVSSv3. */ + class CVSSv3 implements ICVSSv3 { + + /** + * Constructs a new CVSSv3. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1alpha.ICVSSv3); + + /** CVSSv3 baseScore. */ + public baseScore: number; + + /** CVSSv3 exploitabilityScore. */ + public exploitabilityScore: number; + + /** CVSSv3 impactScore. */ + public impactScore: number; + + /** CVSSv3 attackVector. */ + public attackVector: (google.cloud.osconfig.v1alpha.CVSSv3.AttackVector|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.AttackVector); + + /** CVSSv3 attackComplexity. */ + public attackComplexity: (google.cloud.osconfig.v1alpha.CVSSv3.AttackComplexity|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.AttackComplexity); + + /** CVSSv3 privilegesRequired. */ + public privilegesRequired: (google.cloud.osconfig.v1alpha.CVSSv3.PrivilegesRequired|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.PrivilegesRequired); + + /** CVSSv3 userInteraction. */ + public userInteraction: (google.cloud.osconfig.v1alpha.CVSSv3.UserInteraction|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.UserInteraction); + + /** CVSSv3 scope. */ + public scope: (google.cloud.osconfig.v1alpha.CVSSv3.Scope|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.Scope); + + /** CVSSv3 confidentialityImpact. */ + public confidentialityImpact: (google.cloud.osconfig.v1alpha.CVSSv3.Impact|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.Impact); + + /** CVSSv3 integrityImpact. */ + public integrityImpact: (google.cloud.osconfig.v1alpha.CVSSv3.Impact|keyof typeof google.cloud.osconfig.v1alpha.CVSSv3.Impact); + + /** CVSSv3 availabilityImpact. */ + public availabilityImpact: (google.cloud.osconfig.v1alpha.CVSSv3.Impact|keyof typeof google.cloud.osconfig.v1alpha.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.osconfig.v1alpha.ICVSSv3): google.cloud.osconfig.v1alpha.CVSSv3; + + /** + * Encodes the specified CVSSv3 message. Does not implicitly {@link google.cloud.osconfig.v1alpha.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.osconfig.v1alpha.ICVSSv3, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CVSSv3 message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.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.osconfig.v1alpha.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.osconfig.v1alpha.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.osconfig.v1alpha.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.osconfig.v1alpha.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.osconfig.v1alpha.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 + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a 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 Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DateTime. */ + interface IDateTime { + + /** DateTime year */ + year?: (number|null); + + /** DateTime month */ + month?: (number|null); + + /** DateTime day */ + day?: (number|null); + + /** DateTime hours */ + hours?: (number|null); + + /** DateTime minutes */ + minutes?: (number|null); + + /** DateTime seconds */ + seconds?: (number|null); + + /** DateTime nanos */ + nanos?: (number|null); + + /** DateTime utcOffset */ + utcOffset?: (google.protobuf.IDuration|null); + + /** DateTime timeZone */ + timeZone?: (google.type.ITimeZone|null); + } + + /** Represents a DateTime. */ + class DateTime implements IDateTime { + + /** + * Constructs a new DateTime. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDateTime); + + /** DateTime year. */ + public year: number; + + /** DateTime month. */ + public month: number; + + /** DateTime day. */ + public day: number; + + /** DateTime hours. */ + public hours: number; + + /** DateTime minutes. */ + public minutes: number; + + /** DateTime seconds. */ + public seconds: number; + + /** DateTime nanos. */ + public nanos: number; + + /** DateTime utcOffset. */ + public utcOffset?: (google.protobuf.IDuration|null); + + /** DateTime timeZone. */ + public timeZone?: (google.type.ITimeZone|null); + + /** DateTime timeOffset. */ + public timeOffset?: ("utcOffset"|"timeZone"); + + /** + * Creates a new DateTime instance using the specified properties. + * @param [properties] Properties to set + * @returns DateTime instance + */ + public static create(properties?: google.type.IDateTime): google.type.DateTime; + + /** + * Encodes the specified DateTime message. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @param message DateTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @param message DateTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateTime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateTime + * @throws {Error} If the payload is not 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.DateTime; + + /** + * Decodes a DateTime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateTime + * @throws {Error} If the payload 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.DateTime; + + /** + * Verifies a DateTime message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DateTime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateTime + */ + public static fromObject(object: { [k: string]: any }): google.type.DateTime; + + /** + * Creates a plain object from a DateTime message. Also converts values to other types if specified. + * @param message DateTime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.DateTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateTime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeZone. */ + interface ITimeZone { + + /** TimeZone id */ + id?: (string|null); + + /** TimeZone version */ + version?: (string|null); + } + + /** Represents a TimeZone. */ + class TimeZone implements ITimeZone { + + /** + * Constructs a new TimeZone. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ITimeZone); + + /** TimeZone id. */ + public id: string; + + /** TimeZone version. */ + public version: string; + + /** + * Creates a new TimeZone instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeZone instance + */ + public static create(properties?: google.type.ITimeZone): google.type.TimeZone; + + /** + * Encodes the specified TimeZone message. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @param message TimeZone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @param message TimeZone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeZone message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeZone + * @throws {Error} If the payload is not 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.TimeZone; + + /** + * Decodes a TimeZone message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeZone + * @throws {Error} If the payload 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.TimeZone; + + /** + * Verifies a TimeZone message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeZone message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeZone + */ + public static fromObject(object: { [k: string]: any }): google.type.TimeZone; + + /** + * Creates a plain object from a TimeZone message. Also converts values to other types if specified. + * @param message TimeZone + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.TimeZone, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeZone to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeZone + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DayOfWeek enum. */ + enum DayOfWeek { + DAY_OF_WEEK_UNSPECIFIED = 0, + MONDAY = 1, + TUESDAY = 2, + WEDNESDAY = 3, + THURSDAY = 4, + FRIDAY = 5, + SATURDAY = 6, + SUNDAY = 7 + } + + /** Properties of a TimeOfDay. */ + interface ITimeOfDay { + + /** TimeOfDay hours */ + hours?: (number|null); + + /** TimeOfDay minutes */ + minutes?: (number|null); + + /** TimeOfDay seconds */ + seconds?: (number|null); + + /** TimeOfDay nanos */ + nanos?: (number|null); + } + + /** Represents a TimeOfDay. */ + class TimeOfDay implements ITimeOfDay { + + /** + * Constructs a new TimeOfDay. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ITimeOfDay); + + /** TimeOfDay hours. */ + public hours: number; + + /** TimeOfDay minutes. */ + public minutes: number; + + /** TimeOfDay seconds. */ + public seconds: number; + + /** TimeOfDay nanos. */ + public nanos: number; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeOfDay instance + */ + public static create(properties?: google.type.ITimeOfDay): google.type.TimeOfDay; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeOfDay + * @throws {Error} If the payload is not 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.TimeOfDay; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeOfDay + * @throws {Error} If the payload 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.TimeOfDay; + + /** + * Verifies a TimeOfDay message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeOfDay + */ + public static fromObject(object: { [k: string]: any }): google.type.TimeOfDay; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @param message TimeOfDay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.TimeOfDay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeOfDay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeOfDay + * @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-osconfig/protos/protos.js b/packages/google-cloud-osconfig/protos/protos.js new file mode 100644 index 00000000000..89b549dccc9 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/protos.js @@ -0,0 +1,72001 @@ +// 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_os_config_protos || ($protobuf.roots._google_cloud_os_config_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.osconfig = (function() { + + /** + * Namespace osconfig. + * @memberof google.cloud + * @namespace + */ + var osconfig = {}; + + osconfig.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.osconfig + * @namespace + */ + var v1 = {}; + + v1.Inventory = (function() { + + /** + * Properties of an Inventory. + * @memberof google.cloud.osconfig.v1 + * @interface IInventory + * @property {string|null} [name] Inventory name + * @property {google.cloud.osconfig.v1.Inventory.IOsInfo|null} [osInfo] Inventory osInfo + * @property {Object.|null} [items] Inventory items + * @property {google.protobuf.ITimestamp|null} [updateTime] Inventory updateTime + */ + + /** + * Constructs a new Inventory. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an Inventory. + * @implements IInventory + * @constructor + * @param {google.cloud.osconfig.v1.IInventory=} [properties] Properties to set + */ + function Inventory(properties) { + this.items = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Inventory name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.name = ""; + + /** + * Inventory osInfo. + * @member {google.cloud.osconfig.v1.Inventory.IOsInfo|null|undefined} osInfo + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.osInfo = null; + + /** + * Inventory items. + * @member {Object.} items + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.items = $util.emptyObject; + + /** + * Inventory updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.updateTime = null; + + /** + * Creates a new Inventory instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.IInventory=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory} Inventory instance + */ + Inventory.create = function create(properties) { + return new Inventory(properties); + }; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osInfo != null && Object.hasOwnProperty.call(message, "osInfo")) + $root.google.cloud.osconfig.v1.Inventory.OsInfo.encode(message.osInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.osconfig.v1.Inventory.Item.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.name = reader.string(); + break; + } + case 1: { + message.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.items === $util.emptyObject) + message.items = {}; + 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.osconfig.v1.Inventory.Item.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Inventory message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Inventory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.osInfo != null && message.hasOwnProperty("osInfo")) { + var error = $root.google.cloud.osconfig.v1.Inventory.OsInfo.verify(message.osInfo); + if (error) + return "osInfo." + error; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.osconfig.v1.Inventory.Item.verify(message.items[key[i]]); + if (error) + return "items." + 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 Inventory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory} Inventory + */ + Inventory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory(); + if (object.name != null) + message.name = String(object.name); + if (object.osInfo != null) { + if (typeof object.osInfo !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.osInfo: object expected"); + message.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.fromObject(object.osInfo); + } + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.items: object expected"); + message.items[keys[i]] = $root.google.cloud.osconfig.v1.Inventory.Item.fromObject(object.items[keys[i]]); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.Inventory} message Inventory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Inventory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.items = {}; + if (options.defaults) { + object.osInfo = null; + object.name = ""; + object.updateTime = null; + } + if (message.osInfo != null && message.hasOwnProperty("osInfo")) + object.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.toObject(message.osInfo, options); + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.osconfig.v1.Inventory.Item.toObject(message.items[keys2[j]], options); + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Inventory to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + * @returns {Object.} JSON object + */ + Inventory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Inventory + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Inventory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory"; + }; + + Inventory.OsInfo = (function() { + + /** + * Properties of an OsInfo. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IOsInfo + * @property {string|null} [hostname] OsInfo hostname + * @property {string|null} [longName] OsInfo longName + * @property {string|null} [shortName] OsInfo shortName + * @property {string|null} [version] OsInfo version + * @property {string|null} [architecture] OsInfo architecture + * @property {string|null} [kernelVersion] OsInfo kernelVersion + * @property {string|null} [kernelRelease] OsInfo kernelRelease + * @property {string|null} [osconfigAgentVersion] OsInfo osconfigAgentVersion + */ + + /** + * Constructs a new OsInfo. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents an OsInfo. + * @implements IOsInfo + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo=} [properties] Properties to set + */ + function OsInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OsInfo hostname. + * @member {string} hostname + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.hostname = ""; + + /** + * OsInfo longName. + * @member {string} longName + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.longName = ""; + + /** + * OsInfo shortName. + * @member {string} shortName + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.shortName = ""; + + /** + * OsInfo version. + * @member {string} version + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.version = ""; + + /** + * OsInfo architecture. + * @member {string} architecture + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.architecture = ""; + + /** + * OsInfo kernelVersion. + * @member {string} kernelVersion + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.kernelVersion = ""; + + /** + * OsInfo kernelRelease. + * @member {string} kernelRelease + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.kernelRelease = ""; + + /** + * OsInfo osconfigAgentVersion. + * @member {string} osconfigAgentVersion + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.osconfigAgentVersion = ""; + + /** + * Creates a new OsInfo instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo instance + */ + OsInfo.create = function create(properties) { + return new OsInfo(properties); + }; + + /** + * Encodes the specified OsInfo message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo} message OsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.longName != null && Object.hasOwnProperty.call(message, "longName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.longName); + if (message.shortName != null && Object.hasOwnProperty.call(message, "shortName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.shortName); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); + if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.architecture); + if (message.kernelVersion != null && Object.hasOwnProperty.call(message, "kernelVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.kernelVersion); + if (message.kernelRelease != null && Object.hasOwnProperty.call(message, "kernelRelease")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.kernelRelease); + if (message.osconfigAgentVersion != null && Object.hasOwnProperty.call(message, "osconfigAgentVersion")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.osconfigAgentVersion); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.hostname); + return writer; + }; + + /** + * Encodes the specified OsInfo message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo} message OsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OsInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory.OsInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 9: { + message.hostname = reader.string(); + break; + } + case 2: { + message.longName = reader.string(); + break; + } + case 3: { + message.shortName = reader.string(); + break; + } + case 4: { + message.version = reader.string(); + break; + } + case 5: { + message.architecture = reader.string(); + break; + } + case 6: { + message.kernelVersion = reader.string(); + break; + } + case 7: { + message.kernelRelease = reader.string(); + break; + } + case 8: { + message.osconfigAgentVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OsInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OsInfo message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OsInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.longName != null && message.hasOwnProperty("longName")) + if (!$util.isString(message.longName)) + return "longName: string expected"; + if (message.shortName != null && message.hasOwnProperty("shortName")) + if (!$util.isString(message.shortName)) + return "shortName: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.architecture != null && message.hasOwnProperty("architecture")) + if (!$util.isString(message.architecture)) + return "architecture: string expected"; + if (message.kernelVersion != null && message.hasOwnProperty("kernelVersion")) + if (!$util.isString(message.kernelVersion)) + return "kernelVersion: string expected"; + if (message.kernelRelease != null && message.hasOwnProperty("kernelRelease")) + if (!$util.isString(message.kernelRelease)) + return "kernelRelease: string expected"; + if (message.osconfigAgentVersion != null && message.hasOwnProperty("osconfigAgentVersion")) + if (!$util.isString(message.osconfigAgentVersion)) + return "osconfigAgentVersion: string expected"; + return null; + }; + + /** + * Creates an OsInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo + */ + OsInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.OsInfo) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.OsInfo(); + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.longName != null) + message.longName = String(object.longName); + if (object.shortName != null) + message.shortName = String(object.shortName); + if (object.version != null) + message.version = String(object.version); + if (object.architecture != null) + message.architecture = String(object.architecture); + if (object.kernelVersion != null) + message.kernelVersion = String(object.kernelVersion); + if (object.kernelRelease != null) + message.kernelRelease = String(object.kernelRelease); + if (object.osconfigAgentVersion != null) + message.osconfigAgentVersion = String(object.osconfigAgentVersion); + return message; + }; + + /** + * Creates a plain object from an OsInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.OsInfo} message OsInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OsInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.longName = ""; + object.shortName = ""; + object.version = ""; + object.architecture = ""; + object.kernelVersion = ""; + object.kernelRelease = ""; + object.osconfigAgentVersion = ""; + object.hostname = ""; + } + if (message.longName != null && message.hasOwnProperty("longName")) + object.longName = message.longName; + if (message.shortName != null && message.hasOwnProperty("shortName")) + object.shortName = message.shortName; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.architecture != null && message.hasOwnProperty("architecture")) + object.architecture = message.architecture; + if (message.kernelVersion != null && message.hasOwnProperty("kernelVersion")) + object.kernelVersion = message.kernelVersion; + if (message.kernelRelease != null && message.hasOwnProperty("kernelRelease")) + object.kernelRelease = message.kernelRelease; + if (message.osconfigAgentVersion != null && message.hasOwnProperty("osconfigAgentVersion")) + object.osconfigAgentVersion = message.osconfigAgentVersion; + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + return object; + }; + + /** + * Converts this OsInfo to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + * @returns {Object.} JSON object + */ + OsInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OsInfo + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OsInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.OsInfo"; + }; + + return OsInfo; + })(); + + Inventory.Item = (function() { + + /** + * Properties of an Item. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IItem + * @property {string|null} [id] Item id + * @property {google.cloud.osconfig.v1.Inventory.Item.OriginType|null} [originType] Item originType + * @property {google.protobuf.ITimestamp|null} [createTime] Item createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Item updateTime + * @property {google.cloud.osconfig.v1.Inventory.Item.Type|null} [type] Item type + * @property {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null} [installedPackage] Item installedPackage + * @property {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null} [availablePackage] Item availablePackage + */ + + /** + * Constructs a new Item. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents an Item. + * @implements IItem + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IItem=} [properties] Properties to set + */ + function Item(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Item id. + * @member {string} id + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.id = ""; + + /** + * Item originType. + * @member {google.cloud.osconfig.v1.Inventory.Item.OriginType} originType + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.originType = 0; + + /** + * Item createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.createTime = null; + + /** + * Item updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.updateTime = null; + + /** + * Item type. + * @member {google.cloud.osconfig.v1.Inventory.Item.Type} type + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.type = 0; + + /** + * Item installedPackage. + * @member {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null|undefined} installedPackage + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.installedPackage = null; + + /** + * Item availablePackage. + * @member {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null|undefined} availablePackage + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.availablePackage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Item details. + * @member {"installedPackage"|"availablePackage"|undefined} details + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Object.defineProperty(Item.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["installedPackage", "availablePackage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Item instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.IItem=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item instance + */ + Item.create = function create(properties) { + return new Item(properties); + }; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.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.originType != null && Object.hasOwnProperty.call(message, "originType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.originType); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.installedPackage != null && Object.hasOwnProperty.call(message, "installedPackage")) + $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.encode(message.installedPackage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.availablePackage != null && Object.hasOwnProperty.call(message, "availablePackage")) + $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.encode(message.availablePackage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Item message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory.Item(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.originType = reader.int32(); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.decode(reader, reader.uint32()); + break; + } + case 7: { + message.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Item message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Item.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.originType != null && message.hasOwnProperty("originType")) + switch (message.originType) { + default: + return "originType: enum value expected"; + case 0: + case 1: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.installedPackage != null && message.hasOwnProperty("installedPackage")) { + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify(message.installedPackage); + if (error) + return "installedPackage." + error; + } + } + if (message.availablePackage != null && message.hasOwnProperty("availablePackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify(message.availablePackage); + if (error) + return "availablePackage." + error; + } + } + return null; + }; + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item + */ + Item.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.Item) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.Item(); + if (object.id != null) + message.id = String(object.id); + switch (object.originType) { + default: + if (typeof object.originType === "number") { + message.originType = object.originType; + break; + } + break; + case "ORIGIN_TYPE_UNSPECIFIED": + case 0: + message.originType = 0; + break; + case "INVENTORY_REPORT": + case 1: + message.originType = 1; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.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.osconfig.v1.Inventory.Item.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INSTALLED_PACKAGE": + case 1: + message.type = 1; + break; + case "AVAILABLE_PACKAGE": + case 2: + message.type = 2; + break; + } + if (object.installedPackage != null) { + if (typeof object.installedPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.installedPackage: object expected"); + message.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.fromObject(object.installedPackage); + } + if (object.availablePackage != null) { + if (typeof object.availablePackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.availablePackage: object expected"); + message.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.fromObject(object.availablePackage); + } + return message; + }; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.Item} message Item + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Item.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.originType = options.enums === String ? "ORIGIN_TYPE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.originType != null && message.hasOwnProperty("originType")) + object.originType = options.enums === String ? $root.google.cloud.osconfig.v1.Inventory.Item.OriginType[message.originType] === undefined ? message.originType : $root.google.cloud.osconfig.v1.Inventory.Item.OriginType[message.originType] : message.originType; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.osconfig.v1.Inventory.Item.Type[message.type] === undefined ? message.type : $root.google.cloud.osconfig.v1.Inventory.Item.Type[message.type] : message.type; + if (message.installedPackage != null && message.hasOwnProperty("installedPackage")) { + object.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.toObject(message.installedPackage, options); + if (options.oneofs) + object.details = "installedPackage"; + } + if (message.availablePackage != null && message.hasOwnProperty("availablePackage")) { + object.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.toObject(message.availablePackage, options); + if (options.oneofs) + object.details = "availablePackage"; + } + 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 Item to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + * @returns {Object.} JSON object + */ + Item.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Item + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Item.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.Item"; + }; + + /** + * OriginType enum. + * @name google.cloud.osconfig.v1.Inventory.Item.OriginType + * @enum {number} + * @property {number} ORIGIN_TYPE_UNSPECIFIED=0 ORIGIN_TYPE_UNSPECIFIED value + * @property {number} INVENTORY_REPORT=1 INVENTORY_REPORT value + */ + Item.OriginType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORIGIN_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INVENTORY_REPORT"] = 1; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.osconfig.v1.Inventory.Item.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} INSTALLED_PACKAGE=1 INSTALLED_PACKAGE value + * @property {number} AVAILABLE_PACKAGE=2 AVAILABLE_PACKAGE value + */ + Item.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTALLED_PACKAGE"] = 1; + values[valuesById[2] = "AVAILABLE_PACKAGE"] = 2; + return values; + })(); + + return Item; + })(); + + Inventory.SoftwarePackage = (function() { + + /** + * Properties of a SoftwarePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface ISoftwarePackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [yumPackage] SoftwarePackage yumPackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [aptPackage] SoftwarePackage aptPackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [zypperPackage] SoftwarePackage zypperPackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [googetPackage] SoftwarePackage googetPackage + * @property {google.cloud.osconfig.v1.Inventory.IZypperPatch|null} [zypperPatch] SoftwarePackage zypperPatch + * @property {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null} [wuaPackage] SoftwarePackage wuaPackage + * @property {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null} [qfePackage] SoftwarePackage qfePackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [cosPackage] SoftwarePackage cosPackage + * @property {google.cloud.osconfig.v1.Inventory.IWindowsApplication|null} [windowsApplication] SoftwarePackage windowsApplication + */ + + /** + * Constructs a new SoftwarePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a SoftwarePackage. + * @implements ISoftwarePackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage=} [properties] Properties to set + */ + function SoftwarePackage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SoftwarePackage yumPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} yumPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.yumPackage = null; + + /** + * SoftwarePackage aptPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} aptPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.aptPackage = null; + + /** + * SoftwarePackage zypperPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} zypperPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.zypperPackage = null; + + /** + * SoftwarePackage googetPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} googetPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.googetPackage = null; + + /** + * SoftwarePackage zypperPatch. + * @member {google.cloud.osconfig.v1.Inventory.IZypperPatch|null|undefined} zypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.zypperPatch = null; + + /** + * SoftwarePackage wuaPackage. + * @member {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null|undefined} wuaPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.wuaPackage = null; + + /** + * SoftwarePackage qfePackage. + * @member {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null|undefined} qfePackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.qfePackage = null; + + /** + * SoftwarePackage cosPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} cosPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.cosPackage = null; + + /** + * SoftwarePackage windowsApplication. + * @member {google.cloud.osconfig.v1.Inventory.IWindowsApplication|null|undefined} windowsApplication + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.windowsApplication = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SoftwarePackage details. + * @member {"yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|"windowsApplication"|undefined} details + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + Object.defineProperty(SoftwarePackage.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["yumPackage", "aptPackage", "zypperPackage", "googetPackage", "zypperPatch", "wuaPackage", "qfePackage", "cosPackage", "windowsApplication"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SoftwarePackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage instance + */ + SoftwarePackage.create = function create(properties) { + return new SoftwarePackage(properties); + }; + + /** + * Encodes the specified SoftwarePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage} message SoftwarePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwarePackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.yumPackage != null && Object.hasOwnProperty.call(message, "yumPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.yumPackage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.aptPackage != null && Object.hasOwnProperty.call(message, "aptPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.aptPackage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.zypperPackage != null && Object.hasOwnProperty.call(message, "zypperPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.zypperPackage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.googetPackage != null && Object.hasOwnProperty.call(message, "googetPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.googetPackage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.zypperPatch != null && Object.hasOwnProperty.call(message, "zypperPatch")) + $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.encode(message.zypperPatch, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.wuaPackage != null && Object.hasOwnProperty.call(message, "wuaPackage")) + $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.encode(message.wuaPackage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.qfePackage != null && Object.hasOwnProperty.call(message, "qfePackage")) + $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.encode(message.qfePackage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.cosPackage != null && Object.hasOwnProperty.call(message, "cosPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.cosPackage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.windowsApplication != null && Object.hasOwnProperty.call(message, "windowsApplication")) + $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.encode(message.windowsApplication, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SoftwarePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage} message SoftwarePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwarePackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwarePackage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 2: { + message.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 3: { + message.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 4: { + message.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 5: { + message.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.decode(reader, reader.uint32()); + break; + } + case 6: { + message.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.decode(reader, reader.uint32()); + break; + } + case 7: { + message.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.decode(reader, reader.uint32()); + break; + } + case 8: { + message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 9: { + message.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwarePackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoftwarePackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoftwarePackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.yumPackage != null && message.hasOwnProperty("yumPackage")) { + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.yumPackage); + if (error) + return "yumPackage." + error; + } + } + if (message.aptPackage != null && message.hasOwnProperty("aptPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.aptPackage); + if (error) + return "aptPackage." + error; + } + } + if (message.zypperPackage != null && message.hasOwnProperty("zypperPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.zypperPackage); + if (error) + return "zypperPackage." + error; + } + } + if (message.googetPackage != null && message.hasOwnProperty("googetPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.googetPackage); + if (error) + return "googetPackage." + error; + } + } + if (message.zypperPatch != null && message.hasOwnProperty("zypperPatch")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.verify(message.zypperPatch); + if (error) + return "zypperPatch." + error; + } + } + if (message.wuaPackage != null && message.hasOwnProperty("wuaPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify(message.wuaPackage); + if (error) + return "wuaPackage." + error; + } + } + if (message.qfePackage != null && message.hasOwnProperty("qfePackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify(message.qfePackage); + if (error) + return "qfePackage." + error; + } + } + if (message.cosPackage != null && message.hasOwnProperty("cosPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.cosPackage); + if (error) + return "cosPackage." + error; + } + } + if (message.windowsApplication != null && message.hasOwnProperty("windowsApplication")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.verify(message.windowsApplication); + if (error) + return "windowsApplication." + error; + } + } + return null; + }; + + /** + * Creates a SoftwarePackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage + */ + SoftwarePackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage(); + if (object.yumPackage != null) { + if (typeof object.yumPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.yumPackage: object expected"); + message.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.yumPackage); + } + if (object.aptPackage != null) { + if (typeof object.aptPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.aptPackage: object expected"); + message.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.aptPackage); + } + if (object.zypperPackage != null) { + if (typeof object.zypperPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.zypperPackage: object expected"); + message.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.zypperPackage); + } + if (object.googetPackage != null) { + if (typeof object.googetPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.googetPackage: object expected"); + message.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.googetPackage); + } + if (object.zypperPatch != null) { + if (typeof object.zypperPatch !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.zypperPatch: object expected"); + message.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.fromObject(object.zypperPatch); + } + if (object.wuaPackage != null) { + if (typeof object.wuaPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.wuaPackage: object expected"); + message.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.fromObject(object.wuaPackage); + } + if (object.qfePackage != null) { + if (typeof object.qfePackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.qfePackage: object expected"); + message.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.fromObject(object.qfePackage); + } + if (object.cosPackage != null) { + if (typeof object.cosPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.cosPackage: object expected"); + message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.cosPackage); + } + if (object.windowsApplication != null) { + if (typeof object.windowsApplication !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.windowsApplication: object expected"); + message.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.fromObject(object.windowsApplication); + } + return message; + }; + + /** + * Creates a plain object from a SoftwarePackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.SoftwarePackage} message SoftwarePackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoftwarePackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.yumPackage != null && message.hasOwnProperty("yumPackage")) { + object.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.yumPackage, options); + if (options.oneofs) + object.details = "yumPackage"; + } + if (message.aptPackage != null && message.hasOwnProperty("aptPackage")) { + object.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.aptPackage, options); + if (options.oneofs) + object.details = "aptPackage"; + } + if (message.zypperPackage != null && message.hasOwnProperty("zypperPackage")) { + object.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.zypperPackage, options); + if (options.oneofs) + object.details = "zypperPackage"; + } + if (message.googetPackage != null && message.hasOwnProperty("googetPackage")) { + object.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.googetPackage, options); + if (options.oneofs) + object.details = "googetPackage"; + } + if (message.zypperPatch != null && message.hasOwnProperty("zypperPatch")) { + object.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.toObject(message.zypperPatch, options); + if (options.oneofs) + object.details = "zypperPatch"; + } + if (message.wuaPackage != null && message.hasOwnProperty("wuaPackage")) { + object.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.toObject(message.wuaPackage, options); + if (options.oneofs) + object.details = "wuaPackage"; + } + if (message.qfePackage != null && message.hasOwnProperty("qfePackage")) { + object.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.toObject(message.qfePackage, options); + if (options.oneofs) + object.details = "qfePackage"; + } + if (message.cosPackage != null && message.hasOwnProperty("cosPackage")) { + object.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.cosPackage, options); + if (options.oneofs) + object.details = "cosPackage"; + } + if (message.windowsApplication != null && message.hasOwnProperty("windowsApplication")) { + object.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.toObject(message.windowsApplication, options); + if (options.oneofs) + object.details = "windowsApplication"; + } + return object; + }; + + /** + * Converts this SoftwarePackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + * @returns {Object.} JSON object + */ + SoftwarePackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SoftwarePackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SoftwarePackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.SoftwarePackage"; + }; + + return SoftwarePackage; + })(); + + Inventory.VersionedPackage = (function() { + + /** + * Properties of a VersionedPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IVersionedPackage + * @property {string|null} [packageName] VersionedPackage packageName + * @property {string|null} [architecture] VersionedPackage architecture + * @property {string|null} [version] VersionedPackage version + */ + + /** + * Constructs a new VersionedPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a VersionedPackage. + * @implements IVersionedPackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage=} [properties] Properties to set + */ + function VersionedPackage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionedPackage packageName. + * @member {string} packageName + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.packageName = ""; + + /** + * VersionedPackage architecture. + * @member {string} architecture + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.architecture = ""; + + /** + * VersionedPackage version. + * @member {string} version + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.version = ""; + + /** + * Creates a new VersionedPackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage instance + */ + VersionedPackage.create = function create(properties) { + return new VersionedPackage(properties); + }; + + /** + * Encodes the specified VersionedPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage} message VersionedPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedPackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.architecture); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.version); + if (message.packageName != null && Object.hasOwnProperty.call(message, "packageName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.packageName); + return writer; + }; + + /** + * Encodes the specified VersionedPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage} message VersionedPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedPackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedPackage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory.VersionedPackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.packageName = reader.string(); + break; + } + case 2: { + message.architecture = reader.string(); + break; + } + case 3: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedPackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionedPackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionedPackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packageName != null && message.hasOwnProperty("packageName")) + if (!$util.isString(message.packageName)) + return "packageName: string expected"; + if (message.architecture != null && message.hasOwnProperty("architecture")) + if (!$util.isString(message.architecture)) + return "architecture: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a VersionedPackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage + */ + VersionedPackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.VersionedPackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.VersionedPackage(); + if (object.packageName != null) + message.packageName = String(object.packageName); + if (object.architecture != null) + message.architecture = String(object.architecture); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a VersionedPackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.VersionedPackage} message VersionedPackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionedPackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.architecture = ""; + object.version = ""; + object.packageName = ""; + } + if (message.architecture != null && message.hasOwnProperty("architecture")) + object.architecture = message.architecture; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.packageName != null && message.hasOwnProperty("packageName")) + object.packageName = message.packageName; + return object; + }; + + /** + * Converts this VersionedPackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + * @returns {Object.} JSON object + */ + VersionedPackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VersionedPackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VersionedPackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.VersionedPackage"; + }; + + return VersionedPackage; + })(); + + Inventory.ZypperPatch = (function() { + + /** + * Properties of a ZypperPatch. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IZypperPatch + * @property {string|null} [patchName] ZypperPatch patchName + * @property {string|null} [category] ZypperPatch category + * @property {string|null} [severity] ZypperPatch severity + * @property {string|null} [summary] ZypperPatch summary + */ + + /** + * Constructs a new ZypperPatch. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a ZypperPatch. + * @implements IZypperPatch + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set + */ + function ZypperPatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ZypperPatch patchName. + * @member {string} patchName + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.patchName = ""; + + /** + * ZypperPatch category. + * @member {string} category + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.category = ""; + + /** + * ZypperPatch severity. + * @member {string} severity + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.severity = ""; + + /** + * ZypperPatch summary. + * @member {string} summary + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.summary = ""; + + /** + * Creates a new ZypperPatch instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch instance + */ + ZypperPatch.create = function create(properties) { + return new ZypperPatch(properties); + }; + + /** + * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperPatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.category); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.severity); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.summary); + if (message.patchName != null && Object.hasOwnProperty.call(message, "patchName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.patchName); + return writer; + }; + + /** + * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperPatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperPatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory.ZypperPatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.patchName = reader.string(); + break; + } + case 2: { + message.category = reader.string(); + break; + } + case 3: { + message.severity = reader.string(); + break; + } + case 4: { + message.summary = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperPatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZypperPatch message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZypperPatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.patchName != null && message.hasOwnProperty("patchName")) + if (!$util.isString(message.patchName)) + return "patchName: string expected"; + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + if (!$util.isString(message.severity)) + return "severity: string expected"; + if (message.summary != null && message.hasOwnProperty("summary")) + if (!$util.isString(message.summary)) + return "summary: string expected"; + return null; + }; + + /** + * Creates a ZypperPatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + */ + ZypperPatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.ZypperPatch) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.ZypperPatch(); + if (object.patchName != null) + message.patchName = String(object.patchName); + if (object.category != null) + message.category = String(object.category); + if (object.severity != null) + message.severity = String(object.severity); + if (object.summary != null) + message.summary = String(object.summary); + return message; + }; + + /** + * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.ZypperPatch} message ZypperPatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZypperPatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = ""; + object.severity = ""; + object.summary = ""; + object.patchName = ""; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = message.severity; + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = message.summary; + if (message.patchName != null && message.hasOwnProperty("patchName")) + object.patchName = message.patchName; + return object; + }; + + /** + * Converts this ZypperPatch to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + * @returns {Object.} JSON object + */ + ZypperPatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ZypperPatch + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ZypperPatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.ZypperPatch"; + }; + + return ZypperPatch; + })(); + + Inventory.WindowsUpdatePackage = (function() { + + /** + * Properties of a WindowsUpdatePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IWindowsUpdatePackage + * @property {string|null} [title] WindowsUpdatePackage title + * @property {string|null} [description] WindowsUpdatePackage description + * @property {Array.|null} [categories] WindowsUpdatePackage categories + * @property {Array.|null} [kbArticleIds] WindowsUpdatePackage kbArticleIds + * @property {string|null} [supportUrl] WindowsUpdatePackage supportUrl + * @property {Array.|null} [moreInfoUrls] WindowsUpdatePackage moreInfoUrls + * @property {string|null} [updateId] WindowsUpdatePackage updateId + * @property {number|null} [revisionNumber] WindowsUpdatePackage revisionNumber + * @property {google.protobuf.ITimestamp|null} [lastDeploymentChangeTime] WindowsUpdatePackage lastDeploymentChangeTime + */ + + /** + * Constructs a new WindowsUpdatePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a WindowsUpdatePackage. + * @implements IWindowsUpdatePackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + */ + function WindowsUpdatePackage(properties) { + this.categories = []; + this.kbArticleIds = []; + this.moreInfoUrls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowsUpdatePackage title. + * @member {string} title + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.title = ""; + + /** + * WindowsUpdatePackage description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.description = ""; + + /** + * WindowsUpdatePackage categories. + * @member {Array.} categories + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.categories = $util.emptyArray; + + /** + * WindowsUpdatePackage kbArticleIds. + * @member {Array.} kbArticleIds + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.kbArticleIds = $util.emptyArray; + + /** + * WindowsUpdatePackage supportUrl. + * @member {string} supportUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.supportUrl = ""; + + /** + * WindowsUpdatePackage moreInfoUrls. + * @member {Array.} moreInfoUrls + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.moreInfoUrls = $util.emptyArray; + + /** + * WindowsUpdatePackage updateId. + * @member {string} updateId + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.updateId = ""; + + /** + * WindowsUpdatePackage revisionNumber. + * @member {number} revisionNumber + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.revisionNumber = 0; + + /** + * WindowsUpdatePackage lastDeploymentChangeTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastDeploymentChangeTime + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.lastDeploymentChangeTime = null; + + /** + * Creates a new WindowsUpdatePackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage instance + */ + WindowsUpdatePackage.create = function create(properties) { + return new WindowsUpdatePackage(properties); + }; + + /** + * Encodes the specified WindowsUpdatePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdatePackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.encode(message.categories[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.kbArticleIds != null && message.kbArticleIds.length) + for (var i = 0; i < message.kbArticleIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kbArticleIds[i]); + if (message.moreInfoUrls != null && message.moreInfoUrls.length) + for (var i = 0; i < message.moreInfoUrls.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.moreInfoUrls[i]); + if (message.updateId != null && Object.hasOwnProperty.call(message, "updateId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.updateId); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.revisionNumber); + if (message.lastDeploymentChangeTime != null && Object.hasOwnProperty.call(message, "lastDeploymentChangeTime")) + $root.google.protobuf.Timestamp.encode(message.lastDeploymentChangeTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.supportUrl != null && Object.hasOwnProperty.call(message, "supportUrl")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.supportUrl); + return writer; + }; + + /** + * Encodes the specified WindowsUpdatePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdatePackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdatePackage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.title = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push($root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.kbArticleIds && message.kbArticleIds.length)) + message.kbArticleIds = []; + message.kbArticleIds.push(reader.string()); + break; + } + case 11: { + message.supportUrl = reader.string(); + break; + } + case 5: { + if (!(message.moreInfoUrls && message.moreInfoUrls.length)) + message.moreInfoUrls = []; + message.moreInfoUrls.push(reader.string()); + break; + } + case 6: { + message.updateId = reader.string(); + break; + } + case 7: { + message.revisionNumber = reader.int32(); + break; + } + case 10: { + message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdatePackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsUpdatePackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsUpdatePackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify(message.categories[i]); + if (error) + return "categories." + error; + } + } + if (message.kbArticleIds != null && message.hasOwnProperty("kbArticleIds")) { + if (!Array.isArray(message.kbArticleIds)) + return "kbArticleIds: array expected"; + for (var i = 0; i < message.kbArticleIds.length; ++i) + if (!$util.isString(message.kbArticleIds[i])) + return "kbArticleIds: string[] expected"; + } + if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) + if (!$util.isString(message.supportUrl)) + return "supportUrl: string expected"; + if (message.moreInfoUrls != null && message.hasOwnProperty("moreInfoUrls")) { + if (!Array.isArray(message.moreInfoUrls)) + return "moreInfoUrls: array expected"; + for (var i = 0; i < message.moreInfoUrls.length; ++i) + if (!$util.isString(message.moreInfoUrls[i])) + return "moreInfoUrls: string[] expected"; + } + if (message.updateId != null && message.hasOwnProperty("updateId")) + if (!$util.isString(message.updateId)) + return "updateId: string expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber)) + return "revisionNumber: integer expected"; + if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastDeploymentChangeTime); + if (error) + return "lastDeploymentChangeTime." + error; + } + return null; + }; + + /** + * Creates a WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + */ + WindowsUpdatePackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) { + if (typeof object.categories[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: object expected"); + message.categories[i] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.fromObject(object.categories[i]); + } + } + if (object.kbArticleIds) { + if (!Array.isArray(object.kbArticleIds)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.kbArticleIds: array expected"); + message.kbArticleIds = []; + for (var i = 0; i < object.kbArticleIds.length; ++i) + message.kbArticleIds[i] = String(object.kbArticleIds[i]); + } + if (object.supportUrl != null) + message.supportUrl = String(object.supportUrl); + if (object.moreInfoUrls) { + if (!Array.isArray(object.moreInfoUrls)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.moreInfoUrls: array expected"); + message.moreInfoUrls = []; + for (var i = 0; i < object.moreInfoUrls.length; ++i) + message.moreInfoUrls[i] = String(object.moreInfoUrls[i]); + } + if (object.updateId != null) + message.updateId = String(object.updateId); + if (object.revisionNumber != null) + message.revisionNumber = object.revisionNumber | 0; + if (object.lastDeploymentChangeTime != null) { + if (typeof object.lastDeploymentChangeTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.lastDeploymentChangeTime: object expected"); + message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.fromObject(object.lastDeploymentChangeTime); + } + return message; + }; + + /** + * Creates a plain object from a WindowsUpdatePackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} message WindowsUpdatePackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsUpdatePackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.categories = []; + object.kbArticleIds = []; + object.moreInfoUrls = []; + } + if (options.defaults) { + object.title = ""; + object.description = ""; + object.updateId = ""; + object.revisionNumber = 0; + object.lastDeploymentChangeTime = null; + object.supportUrl = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.toObject(message.categories[j], options); + } + if (message.kbArticleIds && message.kbArticleIds.length) { + object.kbArticleIds = []; + for (var j = 0; j < message.kbArticleIds.length; ++j) + object.kbArticleIds[j] = message.kbArticleIds[j]; + } + if (message.moreInfoUrls && message.moreInfoUrls.length) { + object.moreInfoUrls = []; + for (var j = 0; j < message.moreInfoUrls.length; ++j) + object.moreInfoUrls[j] = message.moreInfoUrls[j]; + } + if (message.updateId != null && message.hasOwnProperty("updateId")) + object.updateId = message.updateId; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + object.revisionNumber = message.revisionNumber; + if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) + object.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.toObject(message.lastDeploymentChangeTime, options); + if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) + object.supportUrl = message.supportUrl; + return object; + }; + + /** + * Converts this WindowsUpdatePackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + * @returns {Object.} JSON object + */ + WindowsUpdatePackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowsUpdatePackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsUpdatePackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage"; + }; + + WindowsUpdatePackage.WindowsUpdateCategory = (function() { + + /** + * Properties of a WindowsUpdateCategory. + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @interface IWindowsUpdateCategory + * @property {string|null} [id] WindowsUpdateCategory id + * @property {string|null} [name] WindowsUpdateCategory name + */ + + /** + * Constructs a new WindowsUpdateCategory. + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @classdesc Represents a WindowsUpdateCategory. + * @implements IWindowsUpdateCategory + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set + */ + function WindowsUpdateCategory(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowsUpdateCategory id. + * @member {string} id + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + */ + WindowsUpdateCategory.prototype.id = ""; + + /** + * WindowsUpdateCategory name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + */ + WindowsUpdateCategory.prototype.name = ""; + + /** + * Creates a new WindowsUpdateCategory instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory instance + */ + WindowsUpdateCategory.create = function create(properties) { + return new WindowsUpdateCategory(properties); + }; + + /** + * Encodes the specified WindowsUpdateCategory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateCategory.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified WindowsUpdateCategory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateCategory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateCategory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateCategory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsUpdateCategory message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsUpdateCategory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a WindowsUpdateCategory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + */ + WindowsUpdateCategory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a WindowsUpdateCategory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} message WindowsUpdateCategory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsUpdateCategory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.name = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this WindowsUpdateCategory to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + * @returns {Object.} JSON object + */ + WindowsUpdateCategory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowsUpdateCategory + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsUpdateCategory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory"; + }; + + return WindowsUpdateCategory; + })(); + + return WindowsUpdatePackage; + })(); + + Inventory.WindowsQuickFixEngineeringPackage = (function() { + + /** + * Properties of a WindowsQuickFixEngineeringPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IWindowsQuickFixEngineeringPackage + * @property {string|null} [caption] WindowsQuickFixEngineeringPackage caption + * @property {string|null} [description] WindowsQuickFixEngineeringPackage description + * @property {string|null} [hotFixId] WindowsQuickFixEngineeringPackage hotFixId + * @property {google.protobuf.ITimestamp|null} [installTime] WindowsQuickFixEngineeringPackage installTime + */ + + /** + * Constructs a new WindowsQuickFixEngineeringPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a WindowsQuickFixEngineeringPackage. + * @implements IWindowsQuickFixEngineeringPackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage=} [properties] Properties to set + */ + function WindowsQuickFixEngineeringPackage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowsQuickFixEngineeringPackage caption. + * @member {string} caption + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.caption = ""; + + /** + * WindowsQuickFixEngineeringPackage description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.description = ""; + + /** + * WindowsQuickFixEngineeringPackage hotFixId. + * @member {string} hotFixId + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.hotFixId = ""; + + /** + * WindowsQuickFixEngineeringPackage installTime. + * @member {google.protobuf.ITimestamp|null|undefined} installTime + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.installTime = null; + + /** + * Creates a new WindowsQuickFixEngineeringPackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage instance + */ + WindowsQuickFixEngineeringPackage.create = function create(properties) { + return new WindowsQuickFixEngineeringPackage(properties); + }; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsQuickFixEngineeringPackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.caption); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.hotFixId != null && Object.hasOwnProperty.call(message, "hotFixId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.hotFixId); + if (message.installTime != null && Object.hasOwnProperty.call(message, "installTime")) + $root.google.protobuf.Timestamp.encode(message.installTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsQuickFixEngineeringPackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsQuickFixEngineeringPackage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.caption = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.hotFixId = reader.string(); + break; + } + case 5: { + message.installTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsQuickFixEngineeringPackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsQuickFixEngineeringPackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsQuickFixEngineeringPackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.hotFixId != null && message.hasOwnProperty("hotFixId")) + if (!$util.isString(message.hotFixId)) + return "hotFixId: string expected"; + if (message.installTime != null && message.hasOwnProperty("installTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.installTime); + if (error) + return "installTime." + error; + } + return null; + }; + + /** + * Creates a WindowsQuickFixEngineeringPackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + */ + WindowsQuickFixEngineeringPackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage(); + if (object.caption != null) + message.caption = String(object.caption); + if (object.description != null) + message.description = String(object.description); + if (object.hotFixId != null) + message.hotFixId = String(object.hotFixId); + if (object.installTime != null) { + if (typeof object.installTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.installTime: object expected"); + message.installTime = $root.google.protobuf.Timestamp.fromObject(object.installTime); + } + return message; + }; + + /** + * Creates a plain object from a WindowsQuickFixEngineeringPackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsQuickFixEngineeringPackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.caption = ""; + object.description = ""; + object.hotFixId = ""; + object.installTime = null; + } + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.hotFixId != null && message.hasOwnProperty("hotFixId")) + object.hotFixId = message.hotFixId; + if (message.installTime != null && message.hasOwnProperty("installTime")) + object.installTime = $root.google.protobuf.Timestamp.toObject(message.installTime, options); + return object; + }; + + /** + * Converts this WindowsQuickFixEngineeringPackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + * @returns {Object.} JSON object + */ + WindowsQuickFixEngineeringPackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowsQuickFixEngineeringPackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsQuickFixEngineeringPackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage"; + }; + + return WindowsQuickFixEngineeringPackage; + })(); + + Inventory.WindowsApplication = (function() { + + /** + * Properties of a WindowsApplication. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IWindowsApplication + * @property {string|null} [displayName] WindowsApplication displayName + * @property {string|null} [displayVersion] WindowsApplication displayVersion + * @property {string|null} [publisher] WindowsApplication publisher + * @property {google.type.IDate|null} [installDate] WindowsApplication installDate + * @property {string|null} [helpLink] WindowsApplication helpLink + */ + + /** + * Constructs a new WindowsApplication. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a WindowsApplication. + * @implements IWindowsApplication + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication=} [properties] Properties to set + */ + function WindowsApplication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowsApplication displayName. + * @member {string} displayName + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.displayName = ""; + + /** + * WindowsApplication displayVersion. + * @member {string} displayVersion + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.displayVersion = ""; + + /** + * WindowsApplication publisher. + * @member {string} publisher + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.publisher = ""; + + /** + * WindowsApplication installDate. + * @member {google.type.IDate|null|undefined} installDate + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.installDate = null; + + /** + * WindowsApplication helpLink. + * @member {string} helpLink + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.helpLink = ""; + + /** + * Creates a new WindowsApplication instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication instance + */ + WindowsApplication.create = function create(properties) { + return new WindowsApplication(properties); + }; + + /** + * Encodes the specified WindowsApplication message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication} message WindowsApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsApplication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.displayVersion != null && Object.hasOwnProperty.call(message, "displayVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayVersion); + if (message.publisher != null && Object.hasOwnProperty.call(message, "publisher")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publisher); + if (message.installDate != null && Object.hasOwnProperty.call(message, "installDate")) + $root.google.type.Date.encode(message.installDate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.helpLink != null && Object.hasOwnProperty.call(message, "helpLink")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.helpLink); + return writer; + }; + + /** + * Encodes the specified WindowsApplication message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication} message WindowsApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsApplication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsApplication.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory.WindowsApplication(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.displayVersion = reader.string(); + break; + } + case 3: { + message.publisher = reader.string(); + break; + } + case 4: { + message.installDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 5: { + message.helpLink = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsApplication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsApplication message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsApplication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.displayVersion != null && message.hasOwnProperty("displayVersion")) + if (!$util.isString(message.displayVersion)) + return "displayVersion: string expected"; + if (message.publisher != null && message.hasOwnProperty("publisher")) + if (!$util.isString(message.publisher)) + return "publisher: string expected"; + if (message.installDate != null && message.hasOwnProperty("installDate")) { + var error = $root.google.type.Date.verify(message.installDate); + if (error) + return "installDate." + error; + } + if (message.helpLink != null && message.hasOwnProperty("helpLink")) + if (!$util.isString(message.helpLink)) + return "helpLink: string expected"; + return null; + }; + + /** + * Creates a WindowsApplication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication + */ + WindowsApplication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsApplication) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsApplication(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.displayVersion != null) + message.displayVersion = String(object.displayVersion); + if (object.publisher != null) + message.publisher = String(object.publisher); + if (object.installDate != null) { + if (typeof object.installDate !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsApplication.installDate: object expected"); + message.installDate = $root.google.type.Date.fromObject(object.installDate); + } + if (object.helpLink != null) + message.helpLink = String(object.helpLink); + return message; + }; + + /** + * Creates a plain object from a WindowsApplication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsApplication} message WindowsApplication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsApplication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.displayVersion = ""; + object.publisher = ""; + object.installDate = null; + object.helpLink = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.displayVersion != null && message.hasOwnProperty("displayVersion")) + object.displayVersion = message.displayVersion; + if (message.publisher != null && message.hasOwnProperty("publisher")) + object.publisher = message.publisher; + if (message.installDate != null && message.hasOwnProperty("installDate")) + object.installDate = $root.google.type.Date.toObject(message.installDate, options); + if (message.helpLink != null && message.hasOwnProperty("helpLink")) + object.helpLink = message.helpLink; + return object; + }; + + /** + * Converts this WindowsApplication to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + * @returns {Object.} JSON object + */ + WindowsApplication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowsApplication + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsApplication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.WindowsApplication"; + }; + + return WindowsApplication; + })(); + + return Inventory; + })(); + + v1.GetInventoryRequest = (function() { + + /** + * Properties of a GetInventoryRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IGetInventoryRequest + * @property {string|null} [name] GetInventoryRequest name + * @property {google.cloud.osconfig.v1.InventoryView|null} [view] GetInventoryRequest view + */ + + /** + * Constructs a new GetInventoryRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a GetInventoryRequest. + * @implements IGetInventoryRequest + * @constructor + * @param {google.cloud.osconfig.v1.IGetInventoryRequest=} [properties] Properties to set + */ + function GetInventoryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInventoryRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @instance + */ + GetInventoryRequest.prototype.name = ""; + + /** + * GetInventoryRequest view. + * @member {google.cloud.osconfig.v1.InventoryView} view + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @instance + */ + GetInventoryRequest.prototype.view = 0; + + /** + * Creates a new GetInventoryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.IGetInventoryRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest instance + */ + GetInventoryRequest.create = function create(properties) { + return new GetInventoryRequest(properties); + }; + + /** + * Encodes the specified GetInventoryRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.IGetInventoryRequest} message GetInventoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInventoryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.IGetInventoryRequest} message GetInventoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInventoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInventoryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.GetInventoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInventoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInventoryRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInventoryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest + */ + GetInventoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.GetInventoryRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.GetInventoryRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "INVENTORY_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetInventoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.GetInventoryRequest} message GetInventoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInventoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "INVENTORY_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.osconfig.v1.InventoryView[message.view] === undefined ? message.view : $root.google.cloud.osconfig.v1.InventoryView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetInventoryRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @instance + * @returns {Object.} JSON object + */ + GetInventoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInventoryRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInventoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.GetInventoryRequest"; + }; + + return GetInventoryRequest; + })(); + + v1.ListInventoriesRequest = (function() { + + /** + * Properties of a ListInventoriesRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IListInventoriesRequest + * @property {string|null} [parent] ListInventoriesRequest parent + * @property {google.cloud.osconfig.v1.InventoryView|null} [view] ListInventoriesRequest view + * @property {number|null} [pageSize] ListInventoriesRequest pageSize + * @property {string|null} [pageToken] ListInventoriesRequest pageToken + * @property {string|null} [filter] ListInventoriesRequest filter + */ + + /** + * Constructs a new ListInventoriesRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListInventoriesRequest. + * @implements IListInventoriesRequest + * @constructor + * @param {google.cloud.osconfig.v1.IListInventoriesRequest=} [properties] Properties to set + */ + function ListInventoriesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInventoriesRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.parent = ""; + + /** + * ListInventoriesRequest view. + * @member {google.cloud.osconfig.v1.InventoryView} view + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.view = 0; + + /** + * ListInventoriesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.pageSize = 0; + + /** + * ListInventoriesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.pageToken = ""; + + /** + * ListInventoriesRequest filter. + * @member {string} filter + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.filter = ""; + + /** + * Creates a new ListInventoriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest instance + */ + ListInventoriesRequest.create = function create(properties) { + return new ListInventoriesRequest(properties); + }; + + /** + * Encodes the specified ListInventoriesRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesRequest} message ListInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesRequest} message ListInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListInventoriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInventoriesRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInventoriesRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest + */ + ListInventoriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListInventoriesRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.ListInventoriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "INVENTORY_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListInventoriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.ListInventoriesRequest} message ListInventoriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInventoriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.view = options.enums === String ? "INVENTORY_VIEW_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.osconfig.v1.InventoryView[message.view] === undefined ? message.view : $root.google.cloud.osconfig.v1.InventoryView[message.view] : message.view; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListInventoriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInventoriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInventoriesRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInventoriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListInventoriesRequest"; + }; + + return ListInventoriesRequest; + })(); + + v1.ListInventoriesResponse = (function() { + + /** + * Properties of a ListInventoriesResponse. + * @memberof google.cloud.osconfig.v1 + * @interface IListInventoriesResponse + * @property {Array.|null} [inventories] ListInventoriesResponse inventories + * @property {string|null} [nextPageToken] ListInventoriesResponse nextPageToken + */ + + /** + * Constructs a new ListInventoriesResponse. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListInventoriesResponse. + * @implements IListInventoriesResponse + * @constructor + * @param {google.cloud.osconfig.v1.IListInventoriesResponse=} [properties] Properties to set + */ + function ListInventoriesResponse(properties) { + this.inventories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInventoriesResponse inventories. + * @member {Array.} inventories + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @instance + */ + ListInventoriesResponse.prototype.inventories = $util.emptyArray; + + /** + * ListInventoriesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @instance + */ + ListInventoriesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInventoriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse instance + */ + ListInventoriesResponse.create = function create(properties) { + return new ListInventoriesResponse(properties); + }; + + /** + * Encodes the specified ListInventoriesResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesResponse} message ListInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inventories != null && message.inventories.length) + for (var i = 0; i < message.inventories.length; ++i) + $root.google.cloud.osconfig.v1.Inventory.encode(message.inventories[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 ListInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesResponse} message ListInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListInventoriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.inventories && message.inventories.length)) + message.inventories = []; + message.inventories.push($root.google.cloud.osconfig.v1.Inventory.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInventoriesResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInventoriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inventories != null && message.hasOwnProperty("inventories")) { + if (!Array.isArray(message.inventories)) + return "inventories: array expected"; + for (var i = 0; i < message.inventories.length; ++i) { + var error = $root.google.cloud.osconfig.v1.Inventory.verify(message.inventories[i]); + if (error) + return "inventories." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse + */ + ListInventoriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListInventoriesResponse) + return object; + var message = new $root.google.cloud.osconfig.v1.ListInventoriesResponse(); + if (object.inventories) { + if (!Array.isArray(object.inventories)) + throw TypeError(".google.cloud.osconfig.v1.ListInventoriesResponse.inventories: array expected"); + message.inventories = []; + for (var i = 0; i < object.inventories.length; ++i) { + if (typeof object.inventories[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.ListInventoriesResponse.inventories: object expected"); + message.inventories[i] = $root.google.cloud.osconfig.v1.Inventory.fromObject(object.inventories[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInventoriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.ListInventoriesResponse} message ListInventoriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInventoriesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inventories = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.inventories && message.inventories.length) { + object.inventories = []; + for (var j = 0; j < message.inventories.length; ++j) + object.inventories[j] = $root.google.cloud.osconfig.v1.Inventory.toObject(message.inventories[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInventoriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInventoriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInventoriesResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInventoriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListInventoriesResponse"; + }; + + return ListInventoriesResponse; + })(); + + /** + * InventoryView enum. + * @name google.cloud.osconfig.v1.InventoryView + * @enum {number} + * @property {number} INVENTORY_VIEW_UNSPECIFIED=0 INVENTORY_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1.InventoryView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INVENTORY_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + v1.OSPolicy = (function() { + + /** + * Properties of a OSPolicy. + * @memberof google.cloud.osconfig.v1 + * @interface IOSPolicy + * @property {string|null} [id] OSPolicy id + * @property {string|null} [description] OSPolicy description + * @property {google.cloud.osconfig.v1.OSPolicy.Mode|null} [mode] OSPolicy mode + * @property {Array.|null} [resourceGroups] OSPolicy resourceGroups + * @property {boolean|null} [allowNoResourceGroupMatch] OSPolicy allowNoResourceGroupMatch + */ + + /** + * Constructs a new OSPolicy. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a OSPolicy. + * @implements IOSPolicy + * @constructor + * @param {google.cloud.osconfig.v1.IOSPolicy=} [properties] Properties to set + */ + function OSPolicy(properties) { + this.resourceGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicy id. + * @member {string} id + * @memberof google.cloud.osconfig.v1.OSPolicy + * @instance + */ + OSPolicy.prototype.id = ""; + + /** + * OSPolicy description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.OSPolicy + * @instance + */ + OSPolicy.prototype.description = ""; + + /** + * OSPolicy mode. + * @member {google.cloud.osconfig.v1.OSPolicy.Mode} mode + * @memberof google.cloud.osconfig.v1.OSPolicy + * @instance + */ + OSPolicy.prototype.mode = 0; + + /** + * OSPolicy resourceGroups. + * @member {Array.} resourceGroups + * @memberof google.cloud.osconfig.v1.OSPolicy + * @instance + */ + OSPolicy.prototype.resourceGroups = $util.emptyArray; + + /** + * OSPolicy allowNoResourceGroupMatch. + * @member {boolean} allowNoResourceGroupMatch + * @memberof google.cloud.osconfig.v1.OSPolicy + * @instance + */ + OSPolicy.prototype.allowNoResourceGroupMatch = false; + + /** + * Creates a new OSPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy + * @static + * @param {google.cloud.osconfig.v1.IOSPolicy=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy} OSPolicy instance + */ + OSPolicy.create = function create(properties) { + return new OSPolicy(properties); + }; + + /** + * Encodes the specified OSPolicy message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy + * @static + * @param {google.cloud.osconfig.v1.IOSPolicy} message OSPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicy.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.mode); + if (message.resourceGroups != null && message.resourceGroups.length) + for (var i = 0; i < message.resourceGroups.length; ++i) + $root.google.cloud.osconfig.v1.OSPolicy.ResourceGroup.encode(message.resourceGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allowNoResourceGroupMatch != null && Object.hasOwnProperty.call(message, "allowNoResourceGroupMatch")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowNoResourceGroupMatch); + return writer; + }; + + /** + * Encodes the specified OSPolicy message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy + * @static + * @param {google.cloud.osconfig.v1.IOSPolicy} message OSPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy} OSPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.mode = reader.int32(); + break; + } + case 4: { + if (!(message.resourceGroups && message.resourceGroups.length)) + message.resourceGroups = []; + message.resourceGroups.push($root.google.cloud.osconfig.v1.OSPolicy.ResourceGroup.decode(reader, reader.uint32())); + break; + } + case 5: { + message.allowNoResourceGroupMatch = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy} OSPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicy message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicy.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.resourceGroups != null && message.hasOwnProperty("resourceGroups")) { + if (!Array.isArray(message.resourceGroups)) + return "resourceGroups: array expected"; + for (var i = 0; i < message.resourceGroups.length; ++i) { + var error = $root.google.cloud.osconfig.v1.OSPolicy.ResourceGroup.verify(message.resourceGroups[i]); + if (error) + return "resourceGroups." + error; + } + } + if (message.allowNoResourceGroupMatch != null && message.hasOwnProperty("allowNoResourceGroupMatch")) + if (typeof message.allowNoResourceGroupMatch !== "boolean") + return "allowNoResourceGroupMatch: boolean expected"; + return null; + }; + + /** + * Creates a OSPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy} OSPolicy + */ + OSPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy(); + if (object.id != null) + message.id = String(object.id); + if (object.description != null) + message.description = String(object.description); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "VALIDATION": + case 1: + message.mode = 1; + break; + case "ENFORCEMENT": + case 2: + message.mode = 2; + break; + } + if (object.resourceGroups) { + if (!Array.isArray(object.resourceGroups)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.resourceGroups: array expected"); + message.resourceGroups = []; + for (var i = 0; i < object.resourceGroups.length; ++i) { + if (typeof object.resourceGroups[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.resourceGroups: object expected"); + message.resourceGroups[i] = $root.google.cloud.osconfig.v1.OSPolicy.ResourceGroup.fromObject(object.resourceGroups[i]); + } + } + if (object.allowNoResourceGroupMatch != null) + message.allowNoResourceGroupMatch = Boolean(object.allowNoResourceGroupMatch); + return message; + }; + + /** + * Creates a plain object from a OSPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy + * @static + * @param {google.cloud.osconfig.v1.OSPolicy} message OSPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceGroups = []; + if (options.defaults) { + object.id = ""; + object.description = ""; + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + object.allowNoResourceGroupMatch = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.osconfig.v1.OSPolicy.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.osconfig.v1.OSPolicy.Mode[message.mode] : message.mode; + if (message.resourceGroups && message.resourceGroups.length) { + object.resourceGroups = []; + for (var j = 0; j < message.resourceGroups.length; ++j) + object.resourceGroups[j] = $root.google.cloud.osconfig.v1.OSPolicy.ResourceGroup.toObject(message.resourceGroups[j], options); + } + if (message.allowNoResourceGroupMatch != null && message.hasOwnProperty("allowNoResourceGroupMatch")) + object.allowNoResourceGroupMatch = message.allowNoResourceGroupMatch; + return object; + }; + + /** + * Converts this OSPolicy to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy + * @instance + * @returns {Object.} JSON object + */ + OSPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicy + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy"; + }; + + /** + * Mode enum. + * @name google.cloud.osconfig.v1.OSPolicy.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} VALIDATION=1 VALIDATION value + * @property {number} ENFORCEMENT=2 ENFORCEMENT value + */ + OSPolicy.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VALIDATION"] = 1; + values[valuesById[2] = "ENFORCEMENT"] = 2; + return values; + })(); + + OSPolicy.InventoryFilter = (function() { + + /** + * Properties of an InventoryFilter. + * @memberof google.cloud.osconfig.v1.OSPolicy + * @interface IInventoryFilter + * @property {string|null} [osShortName] InventoryFilter osShortName + * @property {string|null} [osVersion] InventoryFilter osVersion + */ + + /** + * Constructs a new InventoryFilter. + * @memberof google.cloud.osconfig.v1.OSPolicy + * @classdesc Represents an InventoryFilter. + * @implements IInventoryFilter + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.IInventoryFilter=} [properties] Properties to set + */ + function InventoryFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InventoryFilter osShortName. + * @member {string} osShortName + * @memberof google.cloud.osconfig.v1.OSPolicy.InventoryFilter + * @instance + */ + InventoryFilter.prototype.osShortName = ""; + + /** + * InventoryFilter osVersion. + * @member {string} osVersion + * @memberof google.cloud.osconfig.v1.OSPolicy.InventoryFilter + * @instance + */ + InventoryFilter.prototype.osVersion = ""; + + /** + * Creates a new InventoryFilter instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.InventoryFilter + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.IInventoryFilter=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.InventoryFilter} InventoryFilter instance + */ + InventoryFilter.create = function create(properties) { + return new InventoryFilter(properties); + }; + + /** + * Encodes the specified InventoryFilter message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.InventoryFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.InventoryFilter + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.IInventoryFilter} message InventoryFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InventoryFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osShortName != null && Object.hasOwnProperty.call(message, "osShortName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.osShortName); + if (message.osVersion != null && Object.hasOwnProperty.call(message, "osVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.osVersion); + return writer; + }; + + /** + * Encodes the specified InventoryFilter message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.InventoryFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.InventoryFilter + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.IInventoryFilter} message InventoryFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InventoryFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InventoryFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.InventoryFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.InventoryFilter} InventoryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InventoryFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.InventoryFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osShortName = reader.string(); + break; + } + case 2: { + message.osVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InventoryFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.InventoryFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.InventoryFilter} InventoryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InventoryFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InventoryFilter message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.InventoryFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InventoryFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osShortName != null && message.hasOwnProperty("osShortName")) + if (!$util.isString(message.osShortName)) + return "osShortName: string expected"; + if (message.osVersion != null && message.hasOwnProperty("osVersion")) + if (!$util.isString(message.osVersion)) + return "osVersion: string expected"; + return null; + }; + + /** + * Creates an InventoryFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.InventoryFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.InventoryFilter} InventoryFilter + */ + InventoryFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.InventoryFilter) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.InventoryFilter(); + if (object.osShortName != null) + message.osShortName = String(object.osShortName); + if (object.osVersion != null) + message.osVersion = String(object.osVersion); + return message; + }; + + /** + * Creates a plain object from an InventoryFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.InventoryFilter + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.InventoryFilter} message InventoryFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InventoryFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osShortName = ""; + object.osVersion = ""; + } + if (message.osShortName != null && message.hasOwnProperty("osShortName")) + object.osShortName = message.osShortName; + if (message.osVersion != null && message.hasOwnProperty("osVersion")) + object.osVersion = message.osVersion; + return object; + }; + + /** + * Converts this InventoryFilter to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.InventoryFilter + * @instance + * @returns {Object.} JSON object + */ + InventoryFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InventoryFilter + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.InventoryFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InventoryFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.InventoryFilter"; + }; + + return InventoryFilter; + })(); + + OSPolicy.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.osconfig.v1.OSPolicy + * @interface IResource + * @property {string|null} [id] Resource id + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.IPackageResource|null} [pkg] Resource pkg + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.IRepositoryResource|null} [repository] Resource repository + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.IExecResource|null} [exec] Resource exec + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.IFileResource|null} [file] Resource file + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.osconfig.v1.OSPolicy + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.IResource=} [properties] Properties to set + */ + function Resource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resource id. + * @member {string} id + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @instance + */ + Resource.prototype.id = ""; + + /** + * Resource pkg. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.IPackageResource|null|undefined} pkg + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @instance + */ + Resource.prototype.pkg = null; + + /** + * Resource repository. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.IRepositoryResource|null|undefined} repository + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @instance + */ + Resource.prototype.repository = null; + + /** + * Resource exec. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.IExecResource|null|undefined} exec + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @instance + */ + Resource.prototype.exec = null; + + /** + * Resource file. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.IFileResource|null|undefined} file + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @instance + */ + Resource.prototype.file = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Resource resourceType. + * @member {"pkg"|"repository"|"exec"|"file"|undefined} resourceType + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @instance + */ + Object.defineProperty(Resource.prototype, "resourceType", { + get: $util.oneOfGetter($oneOfFields = ["pkg", "repository", "exec", "file"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.IResource=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.pkg != null && Object.hasOwnProperty.call(message, "pkg")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.encode(message.pkg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.repository != null && Object.hasOwnProperty.call(message, "repository")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.encode(message.repository, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.exec != null && Object.hasOwnProperty.call(message, "exec")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.encode(message.exec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.file != null && Object.hasOwnProperty.call(message, "file")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.encode(message.file, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.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.osconfig.v1.OSPolicy.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.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.osconfig.v1.OSPolicy.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.pkg = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.repository = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.exec = $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.decode(reader, reader.uint32()); + break; + } + case 5: { + message.file = $root.google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.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.osconfig.v1.OSPolicy.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.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.osconfig.v1.OSPolicy.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"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.pkg != null && message.hasOwnProperty("pkg")) { + properties.resourceType = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.verify(message.pkg); + if (error) + return "pkg." + error; + } + } + if (message.repository != null && message.hasOwnProperty("repository")) { + if (properties.resourceType === 1) + return "resourceType: multiple values"; + properties.resourceType = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.verify(message.repository); + if (error) + return "repository." + error; + } + } + if (message.exec != null && message.hasOwnProperty("exec")) { + if (properties.resourceType === 1) + return "resourceType: multiple values"; + properties.resourceType = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.verify(message.exec); + if (error) + return "exec." + error; + } + } + if (message.file != null && message.hasOwnProperty("file")) { + if (properties.resourceType === 1) + return "resourceType: multiple values"; + properties.resourceType = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.verify(message.file); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource(); + if (object.id != null) + message.id = String(object.id); + if (object.pkg != null) { + if (typeof object.pkg !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.pkg: object expected"); + message.pkg = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.fromObject(object.pkg); + } + if (object.repository != null) { + if (typeof object.repository !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.repository: object expected"); + message.repository = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.fromObject(object.repository); + } + if (object.exec != null) { + if (typeof object.exec !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.exec: object expected"); + message.exec = $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.fromObject(object.exec); + } + if (object.file != null) { + if (typeof object.file !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.file: object expected"); + message.file = $root.google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.fromObject(object.file); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.pkg != null && message.hasOwnProperty("pkg")) { + object.pkg = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.toObject(message.pkg, options); + if (options.oneofs) + object.resourceType = "pkg"; + } + if (message.repository != null && message.hasOwnProperty("repository")) { + object.repository = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.toObject(message.repository, options); + if (options.oneofs) + object.resourceType = "repository"; + } + if (message.exec != null && message.hasOwnProperty("exec")) { + object.exec = $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.toObject(message.exec, options); + if (options.oneofs) + object.resourceType = "exec"; + } + if (message.file != null && message.hasOwnProperty("file")) { + object.file = $root.google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.toObject(message.file, options); + if (options.oneofs) + object.resourceType = "file"; + } + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.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.osconfig.v1.OSPolicy.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.osconfig.v1.OSPolicy.Resource"; + }; + + Resource.File = (function() { + + /** + * Properties of a File. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @interface IFile + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.File.IRemote|null} [remote] File remote + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.File.IGcs|null} [gcs] File gcs + * @property {string|null} [localPath] File localPath + * @property {boolean|null} [allowInsecure] File allowInsecure + */ + + /** + * Constructs a new File. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @classdesc Represents a File. + * @implements IFile + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.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 remote. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.File.IRemote|null|undefined} remote + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @instance + */ + File.prototype.remote = null; + + /** + * File gcs. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.File.IGcs|null|undefined} gcs + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @instance + */ + File.prototype.gcs = null; + + /** + * File localPath. + * @member {string|null|undefined} localPath + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @instance + */ + File.prototype.localPath = null; + + /** + * File allowInsecure. + * @member {boolean} allowInsecure + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @instance + */ + File.prototype.allowInsecure = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * File type. + * @member {"remote"|"gcs"|"localPath"|undefined} type + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @instance + */ + Object.defineProperty(File.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["remote", "gcs", "localPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new File instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IFile=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.File} File instance + */ + File.create = function create(properties) { + return new File(properties); + }; + + /** + * Encodes the specified File message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.File.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.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.remote != null && Object.hasOwnProperty.call(message, "remote")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote.encode(message.remote, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcs != null && Object.hasOwnProperty.call(message, "gcs")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs.encode(message.gcs, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.localPath != null && Object.hasOwnProperty.call(message, "localPath")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.localPath); + if (message.allowInsecure != null && Object.hasOwnProperty.call(message, "allowInsecure")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowInsecure); + return writer; + }; + + /** + * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.File.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.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.osconfig.v1.OSPolicy.Resource.File + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.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.osconfig.v1.OSPolicy.Resource.File(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.remote = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote.decode(reader, reader.uint32()); + break; + } + case 2: { + message.gcs = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs.decode(reader, reader.uint32()); + break; + } + case 3: { + message.localPath = reader.string(); + break; + } + case 4: { + message.allowInsecure = reader.bool(); + 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.osconfig.v1.OSPolicy.Resource.File + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.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.osconfig.v1.OSPolicy.Resource.File + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + File.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.remote != null && message.hasOwnProperty("remote")) { + properties.type = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote.verify(message.remote); + if (error) + return "remote." + error; + } + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs.verify(message.gcs); + if (error) + return "gcs." + error; + } + } + if (message.localPath != null && message.hasOwnProperty("localPath")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + if (!$util.isString(message.localPath)) + return "localPath: string expected"; + } + if (message.allowInsecure != null && message.hasOwnProperty("allowInsecure")) + if (typeof message.allowInsecure !== "boolean") + return "allowInsecure: boolean expected"; + return null; + }; + + /** + * Creates a File message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.File} File + */ + File.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.File) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.File(); + if (object.remote != null) { + if (typeof object.remote !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.File.remote: object expected"); + message.remote = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote.fromObject(object.remote); + } + if (object.gcs != null) { + if (typeof object.gcs !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.File.gcs: object expected"); + message.gcs = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs.fromObject(object.gcs); + } + if (object.localPath != null) + message.localPath = String(object.localPath); + if (object.allowInsecure != null) + message.allowInsecure = Boolean(object.allowInsecure); + return message; + }; + + /** + * Creates a plain object from a File message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.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.allowInsecure = false; + if (message.remote != null && message.hasOwnProperty("remote")) { + object.remote = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote.toObject(message.remote, options); + if (options.oneofs) + object.type = "remote"; + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + object.gcs = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs.toObject(message.gcs, options); + if (options.oneofs) + object.type = "gcs"; + } + if (message.localPath != null && message.hasOwnProperty("localPath")) { + object.localPath = message.localPath; + if (options.oneofs) + object.type = "localPath"; + } + if (message.allowInsecure != null && message.hasOwnProperty("allowInsecure")) + object.allowInsecure = message.allowInsecure; + return object; + }; + + /** + * Converts this File to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.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.osconfig.v1.OSPolicy.Resource.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.osconfig.v1.OSPolicy.Resource.File"; + }; + + File.Remote = (function() { + + /** + * Properties of a Remote. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @interface IRemote + * @property {string|null} [uri] Remote uri + * @property {string|null} [sha256Checksum] Remote sha256Checksum + */ + + /** + * Constructs a new Remote. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @classdesc Represents a Remote. + * @implements IRemote + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.File.IRemote=} [properties] Properties to set + */ + function Remote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Remote uri. + * @member {string} uri + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote + * @instance + */ + Remote.prototype.uri = ""; + + /** + * Remote sha256Checksum. + * @member {string} sha256Checksum + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote + * @instance + */ + Remote.prototype.sha256Checksum = ""; + + /** + * Creates a new Remote instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.File.IRemote=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote} Remote instance + */ + Remote.create = function create(properties) { + return new Remote(properties); + }; + + /** + * Encodes the specified Remote message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.File.IRemote} message Remote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Remote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.sha256Checksum != null && Object.hasOwnProperty.call(message, "sha256Checksum")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sha256Checksum); + return writer; + }; + + /** + * Encodes the specified Remote message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.File.IRemote} message Remote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Remote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Remote message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote} Remote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Remote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.sha256Checksum = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Remote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote} Remote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Remote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Remote message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Remote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.sha256Checksum != null && message.hasOwnProperty("sha256Checksum")) + if (!$util.isString(message.sha256Checksum)) + return "sha256Checksum: string expected"; + return null; + }; + + /** + * Creates a Remote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote} Remote + */ + Remote.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.sha256Checksum != null) + message.sha256Checksum = String(object.sha256Checksum); + return message; + }; + + /** + * Creates a plain object from a Remote message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote} message Remote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Remote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.sha256Checksum = ""; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.sha256Checksum != null && message.hasOwnProperty("sha256Checksum")) + object.sha256Checksum = message.sha256Checksum; + return object; + }; + + /** + * Converts this Remote to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote + * @instance + * @returns {Object.} JSON object + */ + Remote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Remote + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Remote.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.File.Remote"; + }; + + return Remote; + })(); + + File.Gcs = (function() { + + /** + * Properties of a Gcs. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @interface IGcs + * @property {string|null} [bucket] Gcs bucket + * @property {string|null} [object] Gcs object + * @property {number|Long|null} [generation] Gcs generation + */ + + /** + * Constructs a new Gcs. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File + * @classdesc Represents a Gcs. + * @implements IGcs + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.File.IGcs=} [properties] Properties to set + */ + function Gcs(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Gcs bucket. + * @member {string} bucket + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs + * @instance + */ + Gcs.prototype.bucket = ""; + + /** + * Gcs object. + * @member {string} object + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs + * @instance + */ + Gcs.prototype.object = ""; + + /** + * Gcs generation. + * @member {number|Long} generation + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs + * @instance + */ + Gcs.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Gcs instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.File.IGcs=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs} Gcs instance + */ + Gcs.create = function create(properties) { + return new Gcs(properties); + }; + + /** + * Encodes the specified Gcs message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.File.IGcs} message Gcs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Gcs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + return writer; + }; + + /** + * Encodes the specified Gcs message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.File.IGcs} message Gcs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Gcs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Gcs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs} Gcs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Gcs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.object = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Gcs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs} Gcs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Gcs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Gcs message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Gcs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.object != null && message.hasOwnProperty("object")) + if (!$util.isString(message.object)) + return "object: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + return null; + }; + + /** + * Creates a Gcs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs} Gcs + */ + Gcs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.object != null) + message.object = String(object.object); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Gcs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs} message Gcs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Gcs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.object = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.object != null && message.hasOwnProperty("object")) + object.object = message.object; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + return object; + }; + + /** + * Converts this Gcs to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs + * @instance + * @returns {Object.} JSON object + */ + Gcs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Gcs + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Gcs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.File.Gcs"; + }; + + return Gcs; + })(); + + return File; + })(); + + Resource.PackageResource = (function() { + + /** + * Properties of a PackageResource. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @interface IPackageResource + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.DesiredState|null} [desiredState] PackageResource desiredState + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IAPT|null} [apt] PackageResource apt + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IDeb|null} [deb] PackageResource deb + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IYUM|null} [yum] PackageResource yum + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IZypper|null} [zypper] PackageResource zypper + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IRPM|null} [rpm] PackageResource rpm + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IGooGet|null} [googet] PackageResource googet + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IMSI|null} [msi] PackageResource msi + */ + + /** + * Constructs a new PackageResource. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @classdesc Represents a PackageResource. + * @implements IPackageResource + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IPackageResource=} [properties] Properties to set + */ + function PackageResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PackageResource desiredState. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.DesiredState} desiredState + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.desiredState = 0; + + /** + * PackageResource apt. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IAPT|null|undefined} apt + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.apt = null; + + /** + * PackageResource deb. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IDeb|null|undefined} deb + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.deb = null; + + /** + * PackageResource yum. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IYUM|null|undefined} yum + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.yum = null; + + /** + * PackageResource zypper. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IZypper|null|undefined} zypper + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.zypper = null; + + /** + * PackageResource rpm. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IRPM|null|undefined} rpm + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.rpm = null; + + /** + * PackageResource googet. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IGooGet|null|undefined} googet + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.googet = null; + + /** + * PackageResource msi. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IMSI|null|undefined} msi + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.msi = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PackageResource systemPackage. + * @member {"apt"|"deb"|"yum"|"zypper"|"rpm"|"googet"|"msi"|undefined} systemPackage + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @instance + */ + Object.defineProperty(PackageResource.prototype, "systemPackage", { + get: $util.oneOfGetter($oneOfFields = ["apt", "deb", "yum", "zypper", "rpm", "googet", "msi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PackageResource instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IPackageResource=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource} PackageResource instance + */ + PackageResource.create = function create(properties) { + return new PackageResource(properties); + }; + + /** + * Encodes the specified PackageResource message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IPackageResource} message PackageResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PackageResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.desiredState != null && Object.hasOwnProperty.call(message, "desiredState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.desiredState); + if (message.apt != null && Object.hasOwnProperty.call(message, "apt")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT.encode(message.apt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deb != null && Object.hasOwnProperty.call(message, "deb")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb.encode(message.deb, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.yum != null && Object.hasOwnProperty.call(message, "yum")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM.encode(message.yum, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.zypper != null && Object.hasOwnProperty.call(message, "zypper")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper.encode(message.zypper, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.rpm != null && Object.hasOwnProperty.call(message, "rpm")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM.encode(message.rpm, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.googet != null && Object.hasOwnProperty.call(message, "googet")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet.encode(message.googet, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.msi != null && Object.hasOwnProperty.call(message, "msi")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI.encode(message.msi, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PackageResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IPackageResource} message PackageResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PackageResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PackageResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource} PackageResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PackageResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.desiredState = reader.int32(); + break; + } + case 2: { + message.apt = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deb = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb.decode(reader, reader.uint32()); + break; + } + case 4: { + message.yum = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM.decode(reader, reader.uint32()); + break; + } + case 5: { + message.zypper = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper.decode(reader, reader.uint32()); + break; + } + case 6: { + message.rpm = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM.decode(reader, reader.uint32()); + break; + } + case 7: { + message.googet = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet.decode(reader, reader.uint32()); + break; + } + case 8: { + message.msi = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PackageResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource} PackageResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PackageResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PackageResource message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PackageResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.desiredState != null && message.hasOwnProperty("desiredState")) + switch (message.desiredState) { + default: + return "desiredState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.apt != null && message.hasOwnProperty("apt")) { + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT.verify(message.apt); + if (error) + return "apt." + error; + } + } + if (message.deb != null && message.hasOwnProperty("deb")) { + if (properties.systemPackage === 1) + return "systemPackage: multiple values"; + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb.verify(message.deb); + if (error) + return "deb." + error; + } + } + if (message.yum != null && message.hasOwnProperty("yum")) { + if (properties.systemPackage === 1) + return "systemPackage: multiple values"; + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM.verify(message.yum); + if (error) + return "yum." + error; + } + } + if (message.zypper != null && message.hasOwnProperty("zypper")) { + if (properties.systemPackage === 1) + return "systemPackage: multiple values"; + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper.verify(message.zypper); + if (error) + return "zypper." + error; + } + } + if (message.rpm != null && message.hasOwnProperty("rpm")) { + if (properties.systemPackage === 1) + return "systemPackage: multiple values"; + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM.verify(message.rpm); + if (error) + return "rpm." + error; + } + } + if (message.googet != null && message.hasOwnProperty("googet")) { + if (properties.systemPackage === 1) + return "systemPackage: multiple values"; + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet.verify(message.googet); + if (error) + return "googet." + error; + } + } + if (message.msi != null && message.hasOwnProperty("msi")) { + if (properties.systemPackage === 1) + return "systemPackage: multiple values"; + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI.verify(message.msi); + if (error) + return "msi." + error; + } + } + return null; + }; + + /** + * Creates a PackageResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource} PackageResource + */ + PackageResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource(); + switch (object.desiredState) { + default: + if (typeof object.desiredState === "number") { + message.desiredState = object.desiredState; + break; + } + break; + case "DESIRED_STATE_UNSPECIFIED": + case 0: + message.desiredState = 0; + break; + case "INSTALLED": + case 1: + message.desiredState = 1; + break; + case "REMOVED": + case 2: + message.desiredState = 2; + break; + } + if (object.apt != null) { + if (typeof object.apt !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.apt: object expected"); + message.apt = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT.fromObject(object.apt); + } + if (object.deb != null) { + if (typeof object.deb !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.deb: object expected"); + message.deb = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb.fromObject(object.deb); + } + if (object.yum != null) { + if (typeof object.yum !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.yum: object expected"); + message.yum = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM.fromObject(object.yum); + } + if (object.zypper != null) { + if (typeof object.zypper !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.zypper: object expected"); + message.zypper = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper.fromObject(object.zypper); + } + if (object.rpm != null) { + if (typeof object.rpm !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.rpm: object expected"); + message.rpm = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM.fromObject(object.rpm); + } + if (object.googet != null) { + if (typeof object.googet !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.googet: object expected"); + message.googet = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet.fromObject(object.googet); + } + if (object.msi != null) { + if (typeof object.msi !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.msi: object expected"); + message.msi = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI.fromObject(object.msi); + } + return message; + }; + + /** + * Creates a plain object from a PackageResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource} message PackageResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PackageResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.desiredState = options.enums === String ? "DESIRED_STATE_UNSPECIFIED" : 0; + if (message.desiredState != null && message.hasOwnProperty("desiredState")) + object.desiredState = options.enums === String ? $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.DesiredState[message.desiredState] === undefined ? message.desiredState : $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.DesiredState[message.desiredState] : message.desiredState; + if (message.apt != null && message.hasOwnProperty("apt")) { + object.apt = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT.toObject(message.apt, options); + if (options.oneofs) + object.systemPackage = "apt"; + } + if (message.deb != null && message.hasOwnProperty("deb")) { + object.deb = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb.toObject(message.deb, options); + if (options.oneofs) + object.systemPackage = "deb"; + } + if (message.yum != null && message.hasOwnProperty("yum")) { + object.yum = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM.toObject(message.yum, options); + if (options.oneofs) + object.systemPackage = "yum"; + } + if (message.zypper != null && message.hasOwnProperty("zypper")) { + object.zypper = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper.toObject(message.zypper, options); + if (options.oneofs) + object.systemPackage = "zypper"; + } + if (message.rpm != null && message.hasOwnProperty("rpm")) { + object.rpm = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM.toObject(message.rpm, options); + if (options.oneofs) + object.systemPackage = "rpm"; + } + if (message.googet != null && message.hasOwnProperty("googet")) { + object.googet = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet.toObject(message.googet, options); + if (options.oneofs) + object.systemPackage = "googet"; + } + if (message.msi != null && message.hasOwnProperty("msi")) { + object.msi = $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI.toObject(message.msi, options); + if (options.oneofs) + object.systemPackage = "msi"; + } + return object; + }; + + /** + * Converts this PackageResource to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @instance + * @returns {Object.} JSON object + */ + PackageResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PackageResource + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PackageResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource"; + }; + + /** + * DesiredState enum. + * @name google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.DesiredState + * @enum {number} + * @property {number} DESIRED_STATE_UNSPECIFIED=0 DESIRED_STATE_UNSPECIFIED value + * @property {number} INSTALLED=1 INSTALLED value + * @property {number} REMOVED=2 REMOVED value + */ + PackageResource.DesiredState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DESIRED_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTALLED"] = 1; + values[valuesById[2] = "REMOVED"] = 2; + return values; + })(); + + PackageResource.Deb = (function() { + + /** + * Properties of a Deb. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @interface IDeb + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null} [source] Deb source + * @property {boolean|null} [pullDeps] Deb pullDeps + */ + + /** + * Constructs a new Deb. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @classdesc Represents a Deb. + * @implements IDeb + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IDeb=} [properties] Properties to set + */ + function Deb(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deb source. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null|undefined} source + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb + * @instance + */ + Deb.prototype.source = null; + + /** + * Deb pullDeps. + * @member {boolean} pullDeps + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb + * @instance + */ + Deb.prototype.pullDeps = false; + + /** + * Creates a new Deb instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IDeb=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb} Deb instance + */ + Deb.create = function create(properties) { + return new Deb(properties); + }; + + /** + * Encodes the specified Deb message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IDeb} message Deb message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deb.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pullDeps != null && Object.hasOwnProperty.call(message, "pullDeps")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.pullDeps); + return writer; + }; + + /** + * Encodes the specified Deb message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IDeb} message Deb message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deb.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deb message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb} Deb + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deb.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pullDeps = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deb message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb} Deb + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deb.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deb message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deb.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.osconfig.v1.OSPolicy.Resource.File.verify(message.source); + if (error) + return "source." + error; + } + if (message.pullDeps != null && message.hasOwnProperty("pullDeps")) + if (typeof message.pullDeps !== "boolean") + return "pullDeps: boolean expected"; + return null; + }; + + /** + * Creates a Deb message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb} Deb + */ + Deb.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb.source: object expected"); + message.source = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.fromObject(object.source); + } + if (object.pullDeps != null) + message.pullDeps = Boolean(object.pullDeps); + return message; + }; + + /** + * Creates a plain object from a Deb message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb} message Deb + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deb.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.pullDeps = false; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.toObject(message.source, options); + if (message.pullDeps != null && message.hasOwnProperty("pullDeps")) + object.pullDeps = message.pullDeps; + return object; + }; + + /** + * Converts this Deb to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb + * @instance + * @returns {Object.} JSON object + */ + Deb.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deb + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deb.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Deb"; + }; + + return Deb; + })(); + + PackageResource.APT = (function() { + + /** + * Properties of a APT. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @interface IAPT + * @property {string|null} [name] APT name + */ + + /** + * Constructs a new APT. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @classdesc Represents a APT. + * @implements IAPT + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IAPT=} [properties] Properties to set + */ + function APT(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * APT name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT + * @instance + */ + APT.prototype.name = ""; + + /** + * Creates a new APT instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IAPT=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT} APT instance + */ + APT.create = function create(properties) { + return new APT(properties); + }; + + /** + * Encodes the specified APT message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IAPT} message APT message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + APT.encode = function encode(message, writer) { + 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 APT message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IAPT} message APT message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + APT.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a APT message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT} APT + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + APT.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT(); + 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 APT message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT} APT + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + APT.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a APT message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + APT.verify = function verify(message) { + if (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 APT message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT} APT + */ + APT.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a APT message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT} message APT + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + APT.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 APT to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT + * @instance + * @returns {Object.} JSON object + */ + APT.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for APT + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + APT.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.APT"; + }; + + return APT; + })(); + + PackageResource.RPM = (function() { + + /** + * Properties of a RPM. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @interface IRPM + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null} [source] RPM source + * @property {boolean|null} [pullDeps] RPM pullDeps + */ + + /** + * Constructs a new RPM. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @classdesc Represents a RPM. + * @implements IRPM + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IRPM=} [properties] Properties to set + */ + function RPM(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RPM source. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null|undefined} source + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM + * @instance + */ + RPM.prototype.source = null; + + /** + * RPM pullDeps. + * @member {boolean} pullDeps + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM + * @instance + */ + RPM.prototype.pullDeps = false; + + /** + * Creates a new RPM instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IRPM=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM} RPM instance + */ + RPM.create = function create(properties) { + return new RPM(properties); + }; + + /** + * Encodes the specified RPM message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IRPM} message RPM message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RPM.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pullDeps != null && Object.hasOwnProperty.call(message, "pullDeps")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.pullDeps); + return writer; + }; + + /** + * Encodes the specified RPM message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IRPM} message RPM message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RPM.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RPM message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM} RPM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RPM.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pullDeps = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RPM message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM} RPM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RPM.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RPM message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RPM.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.osconfig.v1.OSPolicy.Resource.File.verify(message.source); + if (error) + return "source." + error; + } + if (message.pullDeps != null && message.hasOwnProperty("pullDeps")) + if (typeof message.pullDeps !== "boolean") + return "pullDeps: boolean expected"; + return null; + }; + + /** + * Creates a RPM message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM} RPM + */ + RPM.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM.source: object expected"); + message.source = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.fromObject(object.source); + } + if (object.pullDeps != null) + message.pullDeps = Boolean(object.pullDeps); + return message; + }; + + /** + * Creates a plain object from a RPM message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM} message RPM + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RPM.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.pullDeps = false; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.toObject(message.source, options); + if (message.pullDeps != null && message.hasOwnProperty("pullDeps")) + object.pullDeps = message.pullDeps; + return object; + }; + + /** + * Converts this RPM to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM + * @instance + * @returns {Object.} JSON object + */ + RPM.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RPM + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RPM.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM"; + }; + + return RPM; + })(); + + PackageResource.YUM = (function() { + + /** + * Properties of a YUM. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @interface IYUM + * @property {string|null} [name] YUM name + */ + + /** + * Constructs a new YUM. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @classdesc Represents a YUM. + * @implements IYUM + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IYUM=} [properties] Properties to set + */ + function YUM(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * YUM name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM + * @instance + */ + YUM.prototype.name = ""; + + /** + * Creates a new YUM instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IYUM=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM} YUM instance + */ + YUM.create = function create(properties) { + return new YUM(properties); + }; + + /** + * Encodes the specified YUM message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IYUM} message YUM message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YUM.encode = function encode(message, writer) { + 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 YUM message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IYUM} message YUM message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YUM.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a YUM message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM} YUM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YUM.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM(); + 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 YUM message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM} YUM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YUM.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a YUM message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + YUM.verify = function verify(message) { + if (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 YUM message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM} YUM + */ + YUM.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a YUM message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM} message YUM + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + YUM.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 YUM to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM + * @instance + * @returns {Object.} JSON object + */ + YUM.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for YUM + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + YUM.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.YUM"; + }; + + return YUM; + })(); + + PackageResource.Zypper = (function() { + + /** + * Properties of a Zypper. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @interface IZypper + * @property {string|null} [name] Zypper name + */ + + /** + * Constructs a new Zypper. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @classdesc Represents a Zypper. + * @implements IZypper + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IZypper=} [properties] Properties to set + */ + function Zypper(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Zypper name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper + * @instance + */ + Zypper.prototype.name = ""; + + /** + * Creates a new Zypper instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IZypper=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper} Zypper instance + */ + Zypper.create = function create(properties) { + return new Zypper(properties); + }; + + /** + * Encodes the specified Zypper message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IZypper} message Zypper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Zypper.encode = function encode(message, writer) { + 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 Zypper message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IZypper} message Zypper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Zypper.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Zypper message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper} Zypper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Zypper.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper(); + 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 Zypper message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper} Zypper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Zypper.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Zypper message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Zypper.verify = function verify(message) { + if (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 Zypper message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper} Zypper + */ + Zypper.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Zypper message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper} message Zypper + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Zypper.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 Zypper to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper + * @instance + * @returns {Object.} JSON object + */ + Zypper.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Zypper + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Zypper.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.Zypper"; + }; + + return Zypper; + })(); + + PackageResource.GooGet = (function() { + + /** + * Properties of a GooGet. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @interface IGooGet + * @property {string|null} [name] GooGet name + */ + + /** + * Constructs a new GooGet. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @classdesc Represents a GooGet. + * @implements IGooGet + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IGooGet=} [properties] Properties to set + */ + function GooGet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GooGet name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet + * @instance + */ + GooGet.prototype.name = ""; + + /** + * Creates a new GooGet instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IGooGet=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet} GooGet instance + */ + GooGet.create = function create(properties) { + return new GooGet(properties); + }; + + /** + * Encodes the specified GooGet message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IGooGet} message GooGet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GooGet.encode = function encode(message, writer) { + 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 GooGet message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IGooGet} message GooGet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GooGet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GooGet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet} GooGet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GooGet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet(); + 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 GooGet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet} GooGet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GooGet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GooGet message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GooGet.verify = function verify(message) { + if (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 GooGet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet} GooGet + */ + GooGet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GooGet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet} message GooGet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GooGet.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 GooGet to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet + * @instance + * @returns {Object.} JSON object + */ + GooGet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GooGet + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GooGet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.GooGet"; + }; + + return GooGet; + })(); + + PackageResource.MSI = (function() { + + /** + * Properties of a MSI. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @interface IMSI + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null} [source] MSI source + * @property {Array.|null} [properties] MSI properties + */ + + /** + * Constructs a new MSI. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource + * @classdesc Represents a MSI. + * @implements IMSI + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IMSI=} [properties] Properties to set + */ + function MSI(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]]; + } + + /** + * MSI source. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null|undefined} source + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI + * @instance + */ + MSI.prototype.source = null; + + /** + * MSI properties. + * @member {Array.} properties + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI + * @instance + */ + MSI.prototype.properties = $util.emptyArray; + + /** + * Creates a new MSI instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IMSI=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI} MSI instance + */ + MSI.create = function create(properties) { + return new MSI(properties); + }; + + /** + * Encodes the specified MSI message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IMSI} message MSI message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MSI.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.properties[i]); + return writer; + }; + + /** + * Encodes the specified MSI message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.IMSI} message MSI message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MSI.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MSI message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI} MSI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MSI.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MSI message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI} MSI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MSI.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MSI message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MSI.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.osconfig.v1.OSPolicy.Resource.File.verify(message.source); + if (error) + return "source." + error; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!Array.isArray(message.properties)) + return "properties: array expected"; + for (var i = 0; i < message.properties.length; ++i) + if (!$util.isString(message.properties[i])) + return "properties: string[] expected"; + } + return null; + }; + + /** + * Creates a MSI message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI} MSI + */ + MSI.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI.source: object expected"); + message.source = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.fromObject(object.source); + } + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI.properties: array expected"); + message.properties = []; + for (var i = 0; i < object.properties.length; ++i) + message.properties[i] = String(object.properties[i]); + } + return message; + }; + + /** + * Creates a plain object from a MSI message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI} message MSI + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MSI.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.properties = []; + if (options.defaults) + object.source = null; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.toObject(message.source, options); + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = message.properties[j]; + } + return object; + }; + + /** + * Converts this MSI to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI + * @instance + * @returns {Object.} JSON object + */ + MSI.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MSI + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MSI.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.MSI"; + }; + + return MSI; + })(); + + return PackageResource; + })(); + + Resource.RepositoryResource = (function() { + + /** + * Properties of a RepositoryResource. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @interface IRepositoryResource + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IAptRepository|null} [apt] RepositoryResource apt + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IYumRepository|null} [yum] RepositoryResource yum + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IZypperRepository|null} [zypper] RepositoryResource zypper + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IGooRepository|null} [goo] RepositoryResource goo + */ + + /** + * Constructs a new RepositoryResource. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @classdesc Represents a RepositoryResource. + * @implements IRepositoryResource + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IRepositoryResource=} [properties] Properties to set + */ + function RepositoryResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RepositoryResource apt. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IAptRepository|null|undefined} apt + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @instance + */ + RepositoryResource.prototype.apt = null; + + /** + * RepositoryResource yum. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IYumRepository|null|undefined} yum + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @instance + */ + RepositoryResource.prototype.yum = null; + + /** + * RepositoryResource zypper. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IZypperRepository|null|undefined} zypper + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @instance + */ + RepositoryResource.prototype.zypper = null; + + /** + * RepositoryResource goo. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IGooRepository|null|undefined} goo + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @instance + */ + RepositoryResource.prototype.goo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RepositoryResource repository. + * @member {"apt"|"yum"|"zypper"|"goo"|undefined} repository + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @instance + */ + Object.defineProperty(RepositoryResource.prototype, "repository", { + get: $util.oneOfGetter($oneOfFields = ["apt", "yum", "zypper", "goo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RepositoryResource instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IRepositoryResource=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource} RepositoryResource instance + */ + RepositoryResource.create = function create(properties) { + return new RepositoryResource(properties); + }; + + /** + * Encodes the specified RepositoryResource message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IRepositoryResource} message RepositoryResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepositoryResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apt != null && Object.hasOwnProperty.call(message, "apt")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.encode(message.apt, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.yum != null && Object.hasOwnProperty.call(message, "yum")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository.encode(message.yum, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.zypper != null && Object.hasOwnProperty.call(message, "zypper")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository.encode(message.zypper, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.goo != null && Object.hasOwnProperty.call(message, "goo")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository.encode(message.goo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RepositoryResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IRepositoryResource} message RepositoryResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepositoryResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RepositoryResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource} RepositoryResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepositoryResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apt = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.decode(reader, reader.uint32()); + break; + } + case 2: { + message.yum = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository.decode(reader, reader.uint32()); + break; + } + case 3: { + message.zypper = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository.decode(reader, reader.uint32()); + break; + } + case 4: { + message.goo = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RepositoryResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource} RepositoryResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepositoryResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RepositoryResource message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RepositoryResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.apt != null && message.hasOwnProperty("apt")) { + properties.repository = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.verify(message.apt); + if (error) + return "apt." + error; + } + } + if (message.yum != null && message.hasOwnProperty("yum")) { + if (properties.repository === 1) + return "repository: multiple values"; + properties.repository = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository.verify(message.yum); + if (error) + return "yum." + error; + } + } + if (message.zypper != null && message.hasOwnProperty("zypper")) { + if (properties.repository === 1) + return "repository: multiple values"; + properties.repository = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository.verify(message.zypper); + if (error) + return "zypper." + error; + } + } + if (message.goo != null && message.hasOwnProperty("goo")) { + if (properties.repository === 1) + return "repository: multiple values"; + properties.repository = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository.verify(message.goo); + if (error) + return "goo." + error; + } + } + return null; + }; + + /** + * Creates a RepositoryResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource} RepositoryResource + */ + RepositoryResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource(); + if (object.apt != null) { + if (typeof object.apt !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.apt: object expected"); + message.apt = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.fromObject(object.apt); + } + if (object.yum != null) { + if (typeof object.yum !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.yum: object expected"); + message.yum = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository.fromObject(object.yum); + } + if (object.zypper != null) { + if (typeof object.zypper !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.zypper: object expected"); + message.zypper = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository.fromObject(object.zypper); + } + if (object.goo != null) { + if (typeof object.goo !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.goo: object expected"); + message.goo = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository.fromObject(object.goo); + } + return message; + }; + + /** + * Creates a plain object from a RepositoryResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource} message RepositoryResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RepositoryResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.apt != null && message.hasOwnProperty("apt")) { + object.apt = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.toObject(message.apt, options); + if (options.oneofs) + object.repository = "apt"; + } + if (message.yum != null && message.hasOwnProperty("yum")) { + object.yum = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository.toObject(message.yum, options); + if (options.oneofs) + object.repository = "yum"; + } + if (message.zypper != null && message.hasOwnProperty("zypper")) { + object.zypper = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository.toObject(message.zypper, options); + if (options.oneofs) + object.repository = "zypper"; + } + if (message.goo != null && message.hasOwnProperty("goo")) { + object.goo = $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository.toObject(message.goo, options); + if (options.oneofs) + object.repository = "goo"; + } + return object; + }; + + /** + * Converts this RepositoryResource to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @instance + * @returns {Object.} JSON object + */ + RepositoryResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RepositoryResource + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RepositoryResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource"; + }; + + RepositoryResource.AptRepository = (function() { + + /** + * Properties of an AptRepository. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @interface IAptRepository + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType|null} [archiveType] AptRepository archiveType + * @property {string|null} [uri] AptRepository uri + * @property {string|null} [distribution] AptRepository distribution + * @property {Array.|null} [components] AptRepository components + * @property {string|null} [gpgKey] AptRepository gpgKey + */ + + /** + * Constructs a new AptRepository. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @classdesc Represents an AptRepository. + * @implements IAptRepository + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IAptRepository=} [properties] Properties to set + */ + function AptRepository(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]]; + } + + /** + * AptRepository archiveType. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType} archiveType + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @instance + */ + AptRepository.prototype.archiveType = 0; + + /** + * AptRepository uri. + * @member {string} uri + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @instance + */ + AptRepository.prototype.uri = ""; + + /** + * AptRepository distribution. + * @member {string} distribution + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @instance + */ + AptRepository.prototype.distribution = ""; + + /** + * AptRepository components. + * @member {Array.} components + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @instance + */ + AptRepository.prototype.components = $util.emptyArray; + + /** + * AptRepository gpgKey. + * @member {string} gpgKey + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @instance + */ + AptRepository.prototype.gpgKey = ""; + + /** + * Creates a new AptRepository instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IAptRepository=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository} AptRepository instance + */ + AptRepository.create = function create(properties) { + return new AptRepository(properties); + }; + + /** + * Encodes the specified AptRepository message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IAptRepository} message AptRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AptRepository.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.archiveType != null && Object.hasOwnProperty.call(message, "archiveType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.archiveType); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.distribution != null && Object.hasOwnProperty.call(message, "distribution")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.distribution); + if (message.components != null && message.components.length) + for (var i = 0; i < message.components.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.components[i]); + if (message.gpgKey != null && Object.hasOwnProperty.call(message, "gpgKey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.gpgKey); + return writer; + }; + + /** + * Encodes the specified AptRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IAptRepository} message AptRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AptRepository.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AptRepository message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository} AptRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AptRepository.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.archiveType = reader.int32(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + case 3: { + message.distribution = reader.string(); + break; + } + case 4: { + if (!(message.components && message.components.length)) + message.components = []; + message.components.push(reader.string()); + break; + } + case 5: { + message.gpgKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AptRepository message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository} AptRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AptRepository.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AptRepository message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AptRepository.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.archiveType != null && message.hasOwnProperty("archiveType")) + switch (message.archiveType) { + default: + return "archiveType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.distribution != null && message.hasOwnProperty("distribution")) + if (!$util.isString(message.distribution)) + return "distribution: 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"; + } + if (message.gpgKey != null && message.hasOwnProperty("gpgKey")) + if (!$util.isString(message.gpgKey)) + return "gpgKey: string expected"; + return null; + }; + + /** + * Creates an AptRepository message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository} AptRepository + */ + AptRepository.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository(); + switch (object.archiveType) { + default: + if (typeof object.archiveType === "number") { + message.archiveType = object.archiveType; + break; + } + break; + case "ARCHIVE_TYPE_UNSPECIFIED": + case 0: + message.archiveType = 0; + break; + case "DEB": + case 1: + message.archiveType = 1; + break; + case "DEB_SRC": + case 2: + message.archiveType = 2; + break; + } + if (object.uri != null) + message.uri = String(object.uri); + if (object.distribution != null) + message.distribution = String(object.distribution); + if (object.components) { + if (!Array.isArray(object.components)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.components: array expected"); + message.components = []; + for (var i = 0; i < object.components.length; ++i) + message.components[i] = String(object.components[i]); + } + if (object.gpgKey != null) + message.gpgKey = String(object.gpgKey); + return message; + }; + + /** + * Creates a plain object from an AptRepository message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository} message AptRepository + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AptRepository.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.components = []; + if (options.defaults) { + object.archiveType = options.enums === String ? "ARCHIVE_TYPE_UNSPECIFIED" : 0; + object.uri = ""; + object.distribution = ""; + object.gpgKey = ""; + } + if (message.archiveType != null && message.hasOwnProperty("archiveType")) + object.archiveType = options.enums === String ? $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType[message.archiveType] === undefined ? message.archiveType : $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType[message.archiveType] : message.archiveType; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.distribution != null && message.hasOwnProperty("distribution")) + object.distribution = message.distribution; + if (message.components && message.components.length) { + object.components = []; + for (var j = 0; j < message.components.length; ++j) + object.components[j] = message.components[j]; + } + if (message.gpgKey != null && message.hasOwnProperty("gpgKey")) + object.gpgKey = message.gpgKey; + return object; + }; + + /** + * Converts this AptRepository to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @instance + * @returns {Object.} JSON object + */ + AptRepository.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AptRepository + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AptRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository"; + }; + + /** + * ArchiveType enum. + * @name google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType + * @enum {number} + * @property {number} ARCHIVE_TYPE_UNSPECIFIED=0 ARCHIVE_TYPE_UNSPECIFIED value + * @property {number} DEB=1 DEB value + * @property {number} DEB_SRC=2 DEB_SRC value + */ + AptRepository.ArchiveType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ARCHIVE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEB"] = 1; + values[valuesById[2] = "DEB_SRC"] = 2; + return values; + })(); + + return AptRepository; + })(); + + RepositoryResource.YumRepository = (function() { + + /** + * Properties of a YumRepository. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @interface IYumRepository + * @property {string|null} [id] YumRepository id + * @property {string|null} [displayName] YumRepository displayName + * @property {string|null} [baseUrl] YumRepository baseUrl + * @property {Array.|null} [gpgKeys] YumRepository gpgKeys + */ + + /** + * Constructs a new YumRepository. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @classdesc Represents a YumRepository. + * @implements IYumRepository + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IYumRepository=} [properties] Properties to set + */ + function YumRepository(properties) { + this.gpgKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * YumRepository id. + * @member {string} id + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @instance + */ + YumRepository.prototype.id = ""; + + /** + * YumRepository displayName. + * @member {string} displayName + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @instance + */ + YumRepository.prototype.displayName = ""; + + /** + * YumRepository baseUrl. + * @member {string} baseUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @instance + */ + YumRepository.prototype.baseUrl = ""; + + /** + * YumRepository gpgKeys. + * @member {Array.} gpgKeys + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @instance + */ + YumRepository.prototype.gpgKeys = $util.emptyArray; + + /** + * Creates a new YumRepository instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IYumRepository=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository} YumRepository instance + */ + YumRepository.create = function create(properties) { + return new YumRepository(properties); + }; + + /** + * Encodes the specified YumRepository message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IYumRepository} message YumRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YumRepository.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.baseUrl != null && Object.hasOwnProperty.call(message, "baseUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.baseUrl); + if (message.gpgKeys != null && message.gpgKeys.length) + for (var i = 0; i < message.gpgKeys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.gpgKeys[i]); + return writer; + }; + + /** + * Encodes the specified YumRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IYumRepository} message YumRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YumRepository.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a YumRepository message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository} YumRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YumRepository.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.baseUrl = reader.string(); + break; + } + case 4: { + if (!(message.gpgKeys && message.gpgKeys.length)) + message.gpgKeys = []; + message.gpgKeys.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a YumRepository message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository} YumRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YumRepository.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a YumRepository message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + YumRepository.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.baseUrl != null && message.hasOwnProperty("baseUrl")) + if (!$util.isString(message.baseUrl)) + return "baseUrl: string expected"; + if (message.gpgKeys != null && message.hasOwnProperty("gpgKeys")) { + if (!Array.isArray(message.gpgKeys)) + return "gpgKeys: array expected"; + for (var i = 0; i < message.gpgKeys.length; ++i) + if (!$util.isString(message.gpgKeys[i])) + return "gpgKeys: string[] expected"; + } + return null; + }; + + /** + * Creates a YumRepository message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository} YumRepository + */ + YumRepository.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.baseUrl != null) + message.baseUrl = String(object.baseUrl); + if (object.gpgKeys) { + if (!Array.isArray(object.gpgKeys)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository.gpgKeys: array expected"); + message.gpgKeys = []; + for (var i = 0; i < object.gpgKeys.length; ++i) + message.gpgKeys[i] = String(object.gpgKeys[i]); + } + return message; + }; + + /** + * Creates a plain object from a YumRepository message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository} message YumRepository + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + YumRepository.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.gpgKeys = []; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + object.baseUrl = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.baseUrl != null && message.hasOwnProperty("baseUrl")) + object.baseUrl = message.baseUrl; + if (message.gpgKeys && message.gpgKeys.length) { + object.gpgKeys = []; + for (var j = 0; j < message.gpgKeys.length; ++j) + object.gpgKeys[j] = message.gpgKeys[j]; + } + return object; + }; + + /** + * Converts this YumRepository to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @instance + * @returns {Object.} JSON object + */ + YumRepository.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for YumRepository + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + YumRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository"; + }; + + return YumRepository; + })(); + + RepositoryResource.ZypperRepository = (function() { + + /** + * Properties of a ZypperRepository. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @interface IZypperRepository + * @property {string|null} [id] ZypperRepository id + * @property {string|null} [displayName] ZypperRepository displayName + * @property {string|null} [baseUrl] ZypperRepository baseUrl + * @property {Array.|null} [gpgKeys] ZypperRepository gpgKeys + */ + + /** + * Constructs a new ZypperRepository. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @classdesc Represents a ZypperRepository. + * @implements IZypperRepository + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IZypperRepository=} [properties] Properties to set + */ + function ZypperRepository(properties) { + this.gpgKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ZypperRepository id. + * @member {string} id + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @instance + */ + ZypperRepository.prototype.id = ""; + + /** + * ZypperRepository displayName. + * @member {string} displayName + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @instance + */ + ZypperRepository.prototype.displayName = ""; + + /** + * ZypperRepository baseUrl. + * @member {string} baseUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @instance + */ + ZypperRepository.prototype.baseUrl = ""; + + /** + * ZypperRepository gpgKeys. + * @member {Array.} gpgKeys + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @instance + */ + ZypperRepository.prototype.gpgKeys = $util.emptyArray; + + /** + * Creates a new ZypperRepository instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IZypperRepository=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository} ZypperRepository instance + */ + ZypperRepository.create = function create(properties) { + return new ZypperRepository(properties); + }; + + /** + * Encodes the specified ZypperRepository message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IZypperRepository} message ZypperRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperRepository.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.baseUrl != null && Object.hasOwnProperty.call(message, "baseUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.baseUrl); + if (message.gpgKeys != null && message.gpgKeys.length) + for (var i = 0; i < message.gpgKeys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.gpgKeys[i]); + return writer; + }; + + /** + * Encodes the specified ZypperRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IZypperRepository} message ZypperRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperRepository.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZypperRepository message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository} ZypperRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperRepository.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.baseUrl = reader.string(); + break; + } + case 4: { + if (!(message.gpgKeys && message.gpgKeys.length)) + message.gpgKeys = []; + message.gpgKeys.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZypperRepository message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository} ZypperRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperRepository.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZypperRepository message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZypperRepository.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.baseUrl != null && message.hasOwnProperty("baseUrl")) + if (!$util.isString(message.baseUrl)) + return "baseUrl: string expected"; + if (message.gpgKeys != null && message.hasOwnProperty("gpgKeys")) { + if (!Array.isArray(message.gpgKeys)) + return "gpgKeys: array expected"; + for (var i = 0; i < message.gpgKeys.length; ++i) + if (!$util.isString(message.gpgKeys[i])) + return "gpgKeys: string[] expected"; + } + return null; + }; + + /** + * Creates a ZypperRepository message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository} ZypperRepository + */ + ZypperRepository.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.baseUrl != null) + message.baseUrl = String(object.baseUrl); + if (object.gpgKeys) { + if (!Array.isArray(object.gpgKeys)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository.gpgKeys: array expected"); + message.gpgKeys = []; + for (var i = 0; i < object.gpgKeys.length; ++i) + message.gpgKeys[i] = String(object.gpgKeys[i]); + } + return message; + }; + + /** + * Creates a plain object from a ZypperRepository message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository} message ZypperRepository + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZypperRepository.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.gpgKeys = []; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + object.baseUrl = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.baseUrl != null && message.hasOwnProperty("baseUrl")) + object.baseUrl = message.baseUrl; + if (message.gpgKeys && message.gpgKeys.length) { + object.gpgKeys = []; + for (var j = 0; j < message.gpgKeys.length; ++j) + object.gpgKeys[j] = message.gpgKeys[j]; + } + return object; + }; + + /** + * Converts this ZypperRepository to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @instance + * @returns {Object.} JSON object + */ + ZypperRepository.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ZypperRepository + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ZypperRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository"; + }; + + return ZypperRepository; + })(); + + RepositoryResource.GooRepository = (function() { + + /** + * Properties of a GooRepository. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @interface IGooRepository + * @property {string|null} [name] GooRepository name + * @property {string|null} [url] GooRepository url + */ + + /** + * Constructs a new GooRepository. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource + * @classdesc Represents a GooRepository. + * @implements IGooRepository + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IGooRepository=} [properties] Properties to set + */ + function GooRepository(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GooRepository name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository + * @instance + */ + GooRepository.prototype.name = ""; + + /** + * GooRepository url. + * @member {string} url + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository + * @instance + */ + GooRepository.prototype.url = ""; + + /** + * Creates a new GooRepository instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IGooRepository=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository} GooRepository instance + */ + GooRepository.create = function create(properties) { + return new GooRepository(properties); + }; + + /** + * Encodes the specified GooRepository message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IGooRepository} message GooRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GooRepository.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); + return writer; + }; + + /** + * Encodes the specified GooRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.IGooRepository} message GooRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GooRepository.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GooRepository message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository} GooRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GooRepository.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GooRepository message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository} GooRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GooRepository.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GooRepository message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GooRepository.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates a GooRepository message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository} GooRepository + */ + GooRepository.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository(); + if (object.name != null) + message.name = String(object.name); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from a GooRepository message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository} message GooRepository + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GooRepository.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.url = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this GooRepository to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository + * @instance + * @returns {Object.} JSON object + */ + GooRepository.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GooRepository + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GooRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository"; + }; + + return GooRepository; + })(); + + return RepositoryResource; + })(); + + Resource.ExecResource = (function() { + + /** + * Properties of an ExecResource. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @interface IExecResource + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec|null} [validate] ExecResource validate + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec|null} [enforce] ExecResource enforce + */ + + /** + * Constructs a new ExecResource. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @classdesc Represents an ExecResource. + * @implements IExecResource + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IExecResource=} [properties] Properties to set + */ + function ExecResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecResource validate. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec|null|undefined} validate + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @instance + */ + ExecResource.prototype.validate = null; + + /** + * ExecResource enforce. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec|null|undefined} enforce + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @instance + */ + ExecResource.prototype.enforce = null; + + /** + * Creates a new ExecResource instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IExecResource=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource} ExecResource instance + */ + ExecResource.create = function create(properties) { + return new ExecResource(properties); + }; + + /** + * Encodes the specified ExecResource message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IExecResource} message ExecResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validate != null && Object.hasOwnProperty.call(message, "validate")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.encode(message.validate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enforce != null && Object.hasOwnProperty.call(message, "enforce")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.encode(message.enforce, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IExecResource} message ExecResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource} ExecResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.validate = $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.enforce = $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource} ExecResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecResource message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validate != null && message.hasOwnProperty("validate")) { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.verify(message.validate); + if (error) + return "validate." + error; + } + if (message.enforce != null && message.hasOwnProperty("enforce")) { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.verify(message.enforce); + if (error) + return "enforce." + error; + } + return null; + }; + + /** + * Creates an ExecResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource} ExecResource + */ + ExecResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource(); + if (object.validate != null) { + if (typeof object.validate !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.validate: object expected"); + message.validate = $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.fromObject(object.validate); + } + if (object.enforce != null) { + if (typeof object.enforce !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.enforce: object expected"); + message.enforce = $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.fromObject(object.enforce); + } + return message; + }; + + /** + * Creates a plain object from an ExecResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource} message ExecResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.validate = null; + object.enforce = null; + } + if (message.validate != null && message.hasOwnProperty("validate")) + object.validate = $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.toObject(message.validate, options); + if (message.enforce != null && message.hasOwnProperty("enforce")) + object.enforce = $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.toObject(message.enforce, options); + return object; + }; + + /** + * Converts this ExecResource to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @instance + * @returns {Object.} JSON object + */ + ExecResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecResource + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource"; + }; + + ExecResource.Exec = (function() { + + /** + * Properties of an Exec. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @interface IExec + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null} [file] Exec file + * @property {string|null} [script] Exec script + * @property {Array.|null} [args] Exec args + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.Interpreter|null} [interpreter] Exec interpreter + * @property {string|null} [outputFilePath] Exec outputFilePath + */ + + /** + * Constructs a new Exec. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource + * @classdesc Represents an Exec. + * @implements IExec + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec=} [properties] Properties to set + */ + function Exec(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Exec file. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null|undefined} file + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @instance + */ + Exec.prototype.file = null; + + /** + * Exec script. + * @member {string|null|undefined} script + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @instance + */ + Exec.prototype.script = null; + + /** + * Exec args. + * @member {Array.} args + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @instance + */ + Exec.prototype.args = $util.emptyArray; + + /** + * Exec interpreter. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.Interpreter} interpreter + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @instance + */ + Exec.prototype.interpreter = 0; + + /** + * Exec outputFilePath. + * @member {string} outputFilePath + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @instance + */ + Exec.prototype.outputFilePath = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Exec source. + * @member {"file"|"script"|undefined} source + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @instance + */ + Object.defineProperty(Exec.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["file", "script"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Exec instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec} Exec instance + */ + Exec.create = function create(properties) { + return new Exec(properties); + }; + + /** + * Encodes the specified Exec message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec} message Exec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && Object.hasOwnProperty.call(message, "file")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.script != null && Object.hasOwnProperty.call(message, "script")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.script); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); + if (message.interpreter != null && Object.hasOwnProperty.call(message, "interpreter")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.interpreter); + if (message.outputFilePath != null && Object.hasOwnProperty.call(message, "outputFilePath")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.outputFilePath); + return writer; + }; + + /** + * Encodes the specified Exec message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.IExec} message Exec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Exec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec} Exec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.file = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.decode(reader, reader.uint32()); + break; + } + case 2: { + message.script = reader.string(); + break; + } + case 3: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 4: { + message.interpreter = reader.int32(); + break; + } + case 5: { + message.outputFilePath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Exec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec} Exec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Exec message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Exec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.file != null && message.hasOwnProperty("file")) { + properties.source = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.verify(message.file); + if (error) + return "file." + error; + } + } + if (message.script != null && message.hasOwnProperty("script")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.script)) + return "script: string expected"; + } + 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.interpreter != null && message.hasOwnProperty("interpreter")) + switch (message.interpreter) { + default: + return "interpreter: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.outputFilePath != null && message.hasOwnProperty("outputFilePath")) + if (!$util.isString(message.outputFilePath)) + return "outputFilePath: string expected"; + return null; + }; + + /** + * Creates an Exec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec} Exec + */ + Exec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec(); + if (object.file != null) { + if (typeof object.file !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.file: object expected"); + message.file = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.fromObject(object.file); + } + if (object.script != null) + message.script = String(object.script); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + switch (object.interpreter) { + default: + if (typeof object.interpreter === "number") { + message.interpreter = object.interpreter; + break; + } + break; + case "INTERPRETER_UNSPECIFIED": + case 0: + message.interpreter = 0; + break; + case "NONE": + case 1: + message.interpreter = 1; + break; + case "SHELL": + case 2: + message.interpreter = 2; + break; + case "POWERSHELL": + case 3: + message.interpreter = 3; + break; + } + if (object.outputFilePath != null) + message.outputFilePath = String(object.outputFilePath); + return message; + }; + + /** + * Creates a plain object from an Exec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec} message Exec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Exec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.interpreter = options.enums === String ? "INTERPRETER_UNSPECIFIED" : 0; + object.outputFilePath = ""; + } + if (message.file != null && message.hasOwnProperty("file")) { + object.file = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.toObject(message.file, options); + if (options.oneofs) + object.source = "file"; + } + if (message.script != null && message.hasOwnProperty("script")) { + object.script = message.script; + if (options.oneofs) + object.source = "script"; + } + 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.interpreter != null && message.hasOwnProperty("interpreter")) + object.interpreter = options.enums === String ? $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.Interpreter[message.interpreter] === undefined ? message.interpreter : $root.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.Interpreter[message.interpreter] : message.interpreter; + if (message.outputFilePath != null && message.hasOwnProperty("outputFilePath")) + object.outputFilePath = message.outputFilePath; + return object; + }; + + /** + * Converts this Exec to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @instance + * @returns {Object.} JSON object + */ + Exec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Exec + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Exec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec"; + }; + + /** + * Interpreter enum. + * @name google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec.Interpreter + * @enum {number} + * @property {number} INTERPRETER_UNSPECIFIED=0 INTERPRETER_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} SHELL=2 SHELL value + * @property {number} POWERSHELL=3 POWERSHELL value + */ + Exec.Interpreter = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERPRETER_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "SHELL"] = 2; + values[valuesById[3] = "POWERSHELL"] = 3; + return values; + })(); + + return Exec; + })(); + + return ExecResource; + })(); + + Resource.FileResource = (function() { + + /** + * Properties of a FileResource. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @interface IFileResource + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null} [file] FileResource file + * @property {string|null} [content] FileResource content + * @property {string|null} [path] FileResource path + * @property {google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.DesiredState|null} [state] FileResource state + * @property {string|null} [permissions] FileResource permissions + */ + + /** + * Constructs a new FileResource. + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource + * @classdesc Represents a FileResource. + * @implements IFileResource + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IFileResource=} [properties] Properties to set + */ + function FileResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileResource file. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.IFile|null|undefined} file + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @instance + */ + FileResource.prototype.file = null; + + /** + * FileResource content. + * @member {string|null|undefined} content + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @instance + */ + FileResource.prototype.content = null; + + /** + * FileResource path. + * @member {string} path + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @instance + */ + FileResource.prototype.path = ""; + + /** + * FileResource state. + * @member {google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.DesiredState} state + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @instance + */ + FileResource.prototype.state = 0; + + /** + * FileResource permissions. + * @member {string} permissions + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @instance + */ + FileResource.prototype.permissions = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FileResource source. + * @member {"file"|"content"|undefined} source + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @instance + */ + Object.defineProperty(FileResource.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["file", "content"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FileResource instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IFileResource=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.FileResource} FileResource instance + */ + FileResource.create = function create(properties) { + return new FileResource(properties); + }; + + /** + * Encodes the specified FileResource message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IFileResource} message FileResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && Object.hasOwnProperty.call(message, "file")) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.path); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.permissions != null && Object.hasOwnProperty.call(message, "permissions")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.permissions); + return writer; + }; + + /** + * Encodes the specified FileResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.IFileResource} message FileResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.FileResource} FileResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.FileResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.file = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.decode(reader, reader.uint32()); + break; + } + case 2: { + message.content = reader.string(); + break; + } + case 3: { + message.path = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.permissions = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.FileResource} FileResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileResource message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.file != null && message.hasOwnProperty("file")) { + properties.source = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.verify(message.file); + if (error) + return "file." + error; + } + } + if (message.content != null && message.hasOwnProperty("content")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.content)) + return "content: string expected"; + } + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.permissions != null && message.hasOwnProperty("permissions")) + if (!$util.isString(message.permissions)) + return "permissions: string expected"; + return null; + }; + + /** + * Creates a FileResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.Resource.FileResource} FileResource + */ + FileResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.Resource.FileResource) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.Resource.FileResource(); + if (object.file != null) { + if (typeof object.file !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.file: object expected"); + message.file = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.fromObject(object.file); + } + if (object.content != null) + message.content = String(object.content); + if (object.path != null) + message.path = String(object.path); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "DESIRED_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PRESENT": + case 1: + message.state = 1; + break; + case "ABSENT": + case 2: + message.state = 2; + break; + case "CONTENTS_MATCH": + case 3: + message.state = 3; + break; + } + if (object.permissions != null) + message.permissions = String(object.permissions); + return message; + }; + + /** + * Creates a plain object from a FileResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.Resource.FileResource} message FileResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.path = ""; + object.state = options.enums === String ? "DESIRED_STATE_UNSPECIFIED" : 0; + object.permissions = ""; + } + if (message.file != null && message.hasOwnProperty("file")) { + object.file = $root.google.cloud.osconfig.v1.OSPolicy.Resource.File.toObject(message.file, options); + if (options.oneofs) + object.source = "file"; + } + if (message.content != null && message.hasOwnProperty("content")) { + object.content = message.content; + if (options.oneofs) + object.source = "content"; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.DesiredState[message.state] === undefined ? message.state : $root.google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.DesiredState[message.state] : message.state; + if (message.permissions != null && message.hasOwnProperty("permissions")) + object.permissions = message.permissions; + return object; + }; + + /** + * Converts this FileResource to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @instance + * @returns {Object.} JSON object + */ + FileResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileResource + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.Resource.FileResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.Resource.FileResource"; + }; + + /** + * DesiredState enum. + * @name google.cloud.osconfig.v1.OSPolicy.Resource.FileResource.DesiredState + * @enum {number} + * @property {number} DESIRED_STATE_UNSPECIFIED=0 DESIRED_STATE_UNSPECIFIED value + * @property {number} PRESENT=1 PRESENT value + * @property {number} ABSENT=2 ABSENT value + * @property {number} CONTENTS_MATCH=3 CONTENTS_MATCH value + */ + FileResource.DesiredState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DESIRED_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRESENT"] = 1; + values[valuesById[2] = "ABSENT"] = 2; + values[valuesById[3] = "CONTENTS_MATCH"] = 3; + return values; + })(); + + return FileResource; + })(); + + return Resource; + })(); + + OSPolicy.ResourceGroup = (function() { + + /** + * Properties of a ResourceGroup. + * @memberof google.cloud.osconfig.v1.OSPolicy + * @interface IResourceGroup + * @property {Array.|null} [inventoryFilters] ResourceGroup inventoryFilters + * @property {Array.|null} [resources] ResourceGroup resources + */ + + /** + * Constructs a new ResourceGroup. + * @memberof google.cloud.osconfig.v1.OSPolicy + * @classdesc Represents a ResourceGroup. + * @implements IResourceGroup + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicy.IResourceGroup=} [properties] Properties to set + */ + function ResourceGroup(properties) { + this.inventoryFilters = []; + this.resources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceGroup inventoryFilters. + * @member {Array.} inventoryFilters + * @memberof google.cloud.osconfig.v1.OSPolicy.ResourceGroup + * @instance + */ + ResourceGroup.prototype.inventoryFilters = $util.emptyArray; + + /** + * ResourceGroup resources. + * @member {Array.} resources + * @memberof google.cloud.osconfig.v1.OSPolicy.ResourceGroup + * @instance + */ + ResourceGroup.prototype.resources = $util.emptyArray; + + /** + * Creates a new ResourceGroup instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicy.ResourceGroup + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.IResourceGroup=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicy.ResourceGroup} ResourceGroup instance + */ + ResourceGroup.create = function create(properties) { + return new ResourceGroup(properties); + }; + + /** + * Encodes the specified ResourceGroup message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.ResourceGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicy.ResourceGroup + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.IResourceGroup} message ResourceGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inventoryFilters != null && message.inventoryFilters.length) + for (var i = 0; i < message.inventoryFilters.length; ++i) + $root.google.cloud.osconfig.v1.OSPolicy.InventoryFilter.encode(message.inventoryFilters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.osconfig.v1.OSPolicy.Resource.encode(message.resources[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourceGroup message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicy.ResourceGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.ResourceGroup + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.IResourceGroup} message ResourceGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicy.ResourceGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicy.ResourceGroup} ResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicy.ResourceGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.inventoryFilters && message.inventoryFilters.length)) + message.inventoryFilters = []; + message.inventoryFilters.push($root.google.cloud.osconfig.v1.OSPolicy.InventoryFilter.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.osconfig.v1.OSPolicy.Resource.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicy.ResourceGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicy.ResourceGroup} ResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceGroup message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicy.ResourceGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inventoryFilters != null && message.hasOwnProperty("inventoryFilters")) { + if (!Array.isArray(message.inventoryFilters)) + return "inventoryFilters: array expected"; + for (var i = 0; i < message.inventoryFilters.length; ++i) { + var error = $root.google.cloud.osconfig.v1.OSPolicy.InventoryFilter.verify(message.inventoryFilters[i]); + if (error) + return "inventoryFilters." + error; + } + } + if (message.resources != null && message.hasOwnProperty("resources")) { + if (!Array.isArray(message.resources)) + return "resources: array expected"; + for (var i = 0; i < message.resources.length; ++i) { + var error = $root.google.cloud.osconfig.v1.OSPolicy.Resource.verify(message.resources[i]); + if (error) + return "resources." + error; + } + } + return null; + }; + + /** + * Creates a ResourceGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicy.ResourceGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicy.ResourceGroup} ResourceGroup + */ + ResourceGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicy.ResourceGroup) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicy.ResourceGroup(); + if (object.inventoryFilters) { + if (!Array.isArray(object.inventoryFilters)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.ResourceGroup.inventoryFilters: array expected"); + message.inventoryFilters = []; + for (var i = 0; i < object.inventoryFilters.length; ++i) { + if (typeof object.inventoryFilters[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.ResourceGroup.inventoryFilters: object expected"); + message.inventoryFilters[i] = $root.google.cloud.osconfig.v1.OSPolicy.InventoryFilter.fromObject(object.inventoryFilters[i]); + } + } + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.ResourceGroup.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicy.ResourceGroup.resources: object expected"); + message.resources[i] = $root.google.cloud.osconfig.v1.OSPolicy.Resource.fromObject(object.resources[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicy.ResourceGroup + * @static + * @param {google.cloud.osconfig.v1.OSPolicy.ResourceGroup} message ResourceGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inventoryFilters = []; + object.resources = []; + } + if (message.inventoryFilters && message.inventoryFilters.length) { + object.inventoryFilters = []; + for (var j = 0; j < message.inventoryFilters.length; ++j) + object.inventoryFilters[j] = $root.google.cloud.osconfig.v1.OSPolicy.InventoryFilter.toObject(message.inventoryFilters[j], options); + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.osconfig.v1.OSPolicy.Resource.toObject(message.resources[j], options); + } + return object; + }; + + /** + * Converts this ResourceGroup to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicy.ResourceGroup + * @instance + * @returns {Object.} JSON object + */ + ResourceGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceGroup + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicy.ResourceGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicy.ResourceGroup"; + }; + + return ResourceGroup; + })(); + + return OSPolicy; + })(); + + v1.GetOSPolicyAssignmentReportRequest = (function() { + + /** + * Properties of a GetOSPolicyAssignmentReportRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IGetOSPolicyAssignmentReportRequest + * @property {string|null} [name] GetOSPolicyAssignmentReportRequest name + */ + + /** + * Constructs a new GetOSPolicyAssignmentReportRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a GetOSPolicyAssignmentReportRequest. + * @implements IGetOSPolicyAssignmentReportRequest + * @constructor + * @param {google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest=} [properties] Properties to set + */ + function GetOSPolicyAssignmentReportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOSPolicyAssignmentReportRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest + * @instance + */ + GetOSPolicyAssignmentReportRequest.prototype.name = ""; + + /** + * Creates a new GetOSPolicyAssignmentReportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest + * @static + * @param {google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest} GetOSPolicyAssignmentReportRequest instance + */ + GetOSPolicyAssignmentReportRequest.create = function create(properties) { + return new GetOSPolicyAssignmentReportRequest(properties); + }; + + /** + * Encodes the specified GetOSPolicyAssignmentReportRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest + * @static + * @param {google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest} message GetOSPolicyAssignmentReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOSPolicyAssignmentReportRequest.encode = function encode(message, writer) { + 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 GetOSPolicyAssignmentReportRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest + * @static + * @param {google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest} message GetOSPolicyAssignmentReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOSPolicyAssignmentReportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOSPolicyAssignmentReportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest} GetOSPolicyAssignmentReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOSPolicyAssignmentReportRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest(); + 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 GetOSPolicyAssignmentReportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest} GetOSPolicyAssignmentReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOSPolicyAssignmentReportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOSPolicyAssignmentReportRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOSPolicyAssignmentReportRequest.verify = function verify(message) { + if (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 GetOSPolicyAssignmentReportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest} GetOSPolicyAssignmentReportRequest + */ + GetOSPolicyAssignmentReportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOSPolicyAssignmentReportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest + * @static + * @param {google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest} message GetOSPolicyAssignmentReportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOSPolicyAssignmentReportRequest.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 GetOSPolicyAssignmentReportRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest + * @instance + * @returns {Object.} JSON object + */ + GetOSPolicyAssignmentReportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOSPolicyAssignmentReportRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOSPolicyAssignmentReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest"; + }; + + return GetOSPolicyAssignmentReportRequest; + })(); + + v1.ListOSPolicyAssignmentReportsRequest = (function() { + + /** + * Properties of a ListOSPolicyAssignmentReportsRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IListOSPolicyAssignmentReportsRequest + * @property {string|null} [parent] ListOSPolicyAssignmentReportsRequest parent + * @property {number|null} [pageSize] ListOSPolicyAssignmentReportsRequest pageSize + * @property {string|null} [filter] ListOSPolicyAssignmentReportsRequest filter + * @property {string|null} [pageToken] ListOSPolicyAssignmentReportsRequest pageToken + */ + + /** + * Constructs a new ListOSPolicyAssignmentReportsRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListOSPolicyAssignmentReportsRequest. + * @implements IListOSPolicyAssignmentReportsRequest + * @constructor + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest=} [properties] Properties to set + */ + function ListOSPolicyAssignmentReportsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOSPolicyAssignmentReportsRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @instance + */ + ListOSPolicyAssignmentReportsRequest.prototype.parent = ""; + + /** + * ListOSPolicyAssignmentReportsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @instance + */ + ListOSPolicyAssignmentReportsRequest.prototype.pageSize = 0; + + /** + * ListOSPolicyAssignmentReportsRequest filter. + * @member {string} filter + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @instance + */ + ListOSPolicyAssignmentReportsRequest.prototype.filter = ""; + + /** + * ListOSPolicyAssignmentReportsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @instance + */ + ListOSPolicyAssignmentReportsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOSPolicyAssignmentReportsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest} ListOSPolicyAssignmentReportsRequest instance + */ + ListOSPolicyAssignmentReportsRequest.create = function create(properties) { + return new ListOSPolicyAssignmentReportsRequest(properties); + }; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest} message ListOSPolicyAssignmentReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentReportsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest} message ListOSPolicyAssignmentReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentReportsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOSPolicyAssignmentReportsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest} ListOSPolicyAssignmentReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentReportsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest(); + 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.filter = reader.string(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOSPolicyAssignmentReportsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest} ListOSPolicyAssignmentReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentReportsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOSPolicyAssignmentReportsRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOSPolicyAssignmentReportsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOSPolicyAssignmentReportsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest} ListOSPolicyAssignmentReportsRequest + */ + ListOSPolicyAssignmentReportsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOSPolicyAssignmentReportsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @static + * @param {google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest} message ListOSPolicyAssignmentReportsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOSPolicyAssignmentReportsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.filter = ""; + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListOSPolicyAssignmentReportsRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOSPolicyAssignmentReportsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOSPolicyAssignmentReportsRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOSPolicyAssignmentReportsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest"; + }; + + return ListOSPolicyAssignmentReportsRequest; + })(); + + v1.ListOSPolicyAssignmentReportsResponse = (function() { + + /** + * Properties of a ListOSPolicyAssignmentReportsResponse. + * @memberof google.cloud.osconfig.v1 + * @interface IListOSPolicyAssignmentReportsResponse + * @property {Array.|null} [osPolicyAssignmentReports] ListOSPolicyAssignmentReportsResponse osPolicyAssignmentReports + * @property {string|null} [nextPageToken] ListOSPolicyAssignmentReportsResponse nextPageToken + */ + + /** + * Constructs a new ListOSPolicyAssignmentReportsResponse. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListOSPolicyAssignmentReportsResponse. + * @implements IListOSPolicyAssignmentReportsResponse + * @constructor + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse=} [properties] Properties to set + */ + function ListOSPolicyAssignmentReportsResponse(properties) { + this.osPolicyAssignmentReports = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOSPolicyAssignmentReportsResponse osPolicyAssignmentReports. + * @member {Array.} osPolicyAssignmentReports + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse + * @instance + */ + ListOSPolicyAssignmentReportsResponse.prototype.osPolicyAssignmentReports = $util.emptyArray; + + /** + * ListOSPolicyAssignmentReportsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse + * @instance + */ + ListOSPolicyAssignmentReportsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOSPolicyAssignmentReportsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse} ListOSPolicyAssignmentReportsResponse instance + */ + ListOSPolicyAssignmentReportsResponse.create = function create(properties) { + return new ListOSPolicyAssignmentReportsResponse(properties); + }; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse} message ListOSPolicyAssignmentReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentReportsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyAssignmentReports != null && message.osPolicyAssignmentReports.length) + for (var i = 0; i < message.osPolicyAssignmentReports.length; ++i) + $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.encode(message.osPolicyAssignmentReports[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 ListOSPolicyAssignmentReportsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse} message ListOSPolicyAssignmentReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentReportsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOSPolicyAssignmentReportsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse} ListOSPolicyAssignmentReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentReportsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.osPolicyAssignmentReports && message.osPolicyAssignmentReports.length)) + message.osPolicyAssignmentReports = []; + message.osPolicyAssignmentReports.push($root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOSPolicyAssignmentReportsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse} ListOSPolicyAssignmentReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentReportsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOSPolicyAssignmentReportsResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOSPolicyAssignmentReportsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osPolicyAssignmentReports != null && message.hasOwnProperty("osPolicyAssignmentReports")) { + if (!Array.isArray(message.osPolicyAssignmentReports)) + return "osPolicyAssignmentReports: array expected"; + for (var i = 0; i < message.osPolicyAssignmentReports.length; ++i) { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.verify(message.osPolicyAssignmentReports[i]); + if (error) + return "osPolicyAssignmentReports." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOSPolicyAssignmentReportsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse} ListOSPolicyAssignmentReportsResponse + */ + ListOSPolicyAssignmentReportsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse) + return object; + var message = new $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse(); + if (object.osPolicyAssignmentReports) { + if (!Array.isArray(object.osPolicyAssignmentReports)) + throw TypeError(".google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse.osPolicyAssignmentReports: array expected"); + message.osPolicyAssignmentReports = []; + for (var i = 0; i < object.osPolicyAssignmentReports.length; ++i) { + if (typeof object.osPolicyAssignmentReports[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse.osPolicyAssignmentReports: object expected"); + message.osPolicyAssignmentReports[i] = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.fromObject(object.osPolicyAssignmentReports[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOSPolicyAssignmentReportsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse + * @static + * @param {google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse} message ListOSPolicyAssignmentReportsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOSPolicyAssignmentReportsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicyAssignmentReports = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.osPolicyAssignmentReports && message.osPolicyAssignmentReports.length) { + object.osPolicyAssignmentReports = []; + for (var j = 0; j < message.osPolicyAssignmentReports.length; ++j) + object.osPolicyAssignmentReports[j] = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.toObject(message.osPolicyAssignmentReports[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOSPolicyAssignmentReportsResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOSPolicyAssignmentReportsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOSPolicyAssignmentReportsResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOSPolicyAssignmentReportsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse"; + }; + + return ListOSPolicyAssignmentReportsResponse; + })(); + + v1.OSPolicyAssignmentReport = (function() { + + /** + * Properties of a OSPolicyAssignmentReport. + * @memberof google.cloud.osconfig.v1 + * @interface IOSPolicyAssignmentReport + * @property {string|null} [name] OSPolicyAssignmentReport name + * @property {string|null} [instance] OSPolicyAssignmentReport instance + * @property {string|null} [osPolicyAssignment] OSPolicyAssignmentReport osPolicyAssignment + * @property {Array.|null} [osPolicyCompliances] OSPolicyAssignmentReport osPolicyCompliances + * @property {google.protobuf.ITimestamp|null} [updateTime] OSPolicyAssignmentReport updateTime + * @property {string|null} [lastRunId] OSPolicyAssignmentReport lastRunId + */ + + /** + * Constructs a new OSPolicyAssignmentReport. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a OSPolicyAssignmentReport. + * @implements IOSPolicyAssignmentReport + * @constructor + * @param {google.cloud.osconfig.v1.IOSPolicyAssignmentReport=} [properties] Properties to set + */ + function OSPolicyAssignmentReport(properties) { + this.osPolicyCompliances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyAssignmentReport name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @instance + */ + OSPolicyAssignmentReport.prototype.name = ""; + + /** + * OSPolicyAssignmentReport instance. + * @member {string} instance + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @instance + */ + OSPolicyAssignmentReport.prototype.instance = ""; + + /** + * OSPolicyAssignmentReport osPolicyAssignment. + * @member {string} osPolicyAssignment + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @instance + */ + OSPolicyAssignmentReport.prototype.osPolicyAssignment = ""; + + /** + * OSPolicyAssignmentReport osPolicyCompliances. + * @member {Array.} osPolicyCompliances + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @instance + */ + OSPolicyAssignmentReport.prototype.osPolicyCompliances = $util.emptyArray; + + /** + * OSPolicyAssignmentReport updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @instance + */ + OSPolicyAssignmentReport.prototype.updateTime = null; + + /** + * OSPolicyAssignmentReport lastRunId. + * @member {string} lastRunId + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @instance + */ + OSPolicyAssignmentReport.prototype.lastRunId = ""; + + /** + * Creates a new OSPolicyAssignmentReport instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @static + * @param {google.cloud.osconfig.v1.IOSPolicyAssignmentReport=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport} OSPolicyAssignmentReport instance + */ + OSPolicyAssignmentReport.create = function create(properties) { + return new OSPolicyAssignmentReport(properties); + }; + + /** + * Encodes the specified OSPolicyAssignmentReport message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @static + * @param {google.cloud.osconfig.v1.IOSPolicyAssignmentReport} message OSPolicyAssignmentReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyAssignmentReport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instance); + if (message.osPolicyAssignment != null && Object.hasOwnProperty.call(message, "osPolicyAssignment")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.osPolicyAssignment); + if (message.osPolicyCompliances != null && message.osPolicyCompliances.length) + for (var i = 0; i < message.osPolicyCompliances.length; ++i) + $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.encode(message.osPolicyCompliances[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastRunId != null && Object.hasOwnProperty.call(message, "lastRunId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.lastRunId); + return writer; + }; + + /** + * Encodes the specified OSPolicyAssignmentReport message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @static + * @param {google.cloud.osconfig.v1.IOSPolicyAssignmentReport} message OSPolicyAssignmentReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyAssignmentReport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyAssignmentReport message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport} OSPolicyAssignmentReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyAssignmentReport.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.instance = reader.string(); + break; + } + case 3: { + message.osPolicyAssignment = reader.string(); + break; + } + case 4: { + if (!(message.osPolicyCompliances && message.osPolicyCompliances.length)) + message.osPolicyCompliances = []; + message.osPolicyCompliances.push($root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.decode(reader, reader.uint32())); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.lastRunId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyAssignmentReport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport} OSPolicyAssignmentReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyAssignmentReport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyAssignmentReport message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyAssignmentReport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + if (!$util.isString(message.osPolicyAssignment)) + return "osPolicyAssignment: string expected"; + if (message.osPolicyCompliances != null && message.hasOwnProperty("osPolicyCompliances")) { + if (!Array.isArray(message.osPolicyCompliances)) + return "osPolicyCompliances: array expected"; + for (var i = 0; i < message.osPolicyCompliances.length; ++i) { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.verify(message.osPolicyCompliances[i]); + if (error) + return "osPolicyCompliances." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.lastRunId != null && message.hasOwnProperty("lastRunId")) + if (!$util.isString(message.lastRunId)) + return "lastRunId: string expected"; + return null; + }; + + /** + * Creates a OSPolicyAssignmentReport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport} OSPolicyAssignmentReport + */ + OSPolicyAssignmentReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport(); + if (object.name != null) + message.name = String(object.name); + if (object.instance != null) + message.instance = String(object.instance); + if (object.osPolicyAssignment != null) + message.osPolicyAssignment = String(object.osPolicyAssignment); + if (object.osPolicyCompliances) { + if (!Array.isArray(object.osPolicyCompliances)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignmentReport.osPolicyCompliances: array expected"); + message.osPolicyCompliances = []; + for (var i = 0; i < object.osPolicyCompliances.length; ++i) { + if (typeof object.osPolicyCompliances[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignmentReport.osPolicyCompliances: object expected"); + message.osPolicyCompliances[i] = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.fromObject(object.osPolicyCompliances[i]); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignmentReport.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lastRunId != null) + message.lastRunId = String(object.lastRunId); + return message; + }; + + /** + * Creates a plain object from a OSPolicyAssignmentReport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport} message OSPolicyAssignmentReport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyAssignmentReport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicyCompliances = []; + if (options.defaults) { + object.name = ""; + object.instance = ""; + object.osPolicyAssignment = ""; + object.updateTime = null; + object.lastRunId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + object.osPolicyAssignment = message.osPolicyAssignment; + if (message.osPolicyCompliances && message.osPolicyCompliances.length) { + object.osPolicyCompliances = []; + for (var j = 0; j < message.osPolicyCompliances.length; ++j) + object.osPolicyCompliances[j] = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.toObject(message.osPolicyCompliances[j], options); + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.lastRunId != null && message.hasOwnProperty("lastRunId")) + object.lastRunId = message.lastRunId; + return object; + }; + + /** + * Converts this OSPolicyAssignmentReport to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @instance + * @returns {Object.} JSON object + */ + OSPolicyAssignmentReport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyAssignmentReport + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyAssignmentReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicyAssignmentReport"; + }; + + OSPolicyAssignmentReport.OSPolicyCompliance = (function() { + + /** + * Properties of a OSPolicyCompliance. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @interface IOSPolicyCompliance + * @property {string|null} [osPolicyId] OSPolicyCompliance osPolicyId + * @property {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState|null} [complianceState] OSPolicyCompliance complianceState + * @property {string|null} [complianceStateReason] OSPolicyCompliance complianceStateReason + * @property {Array.|null} [osPolicyResourceCompliances] OSPolicyCompliance osPolicyResourceCompliances + */ + + /** + * Constructs a new OSPolicyCompliance. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport + * @classdesc Represents a OSPolicyCompliance. + * @implements IOSPolicyCompliance + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.IOSPolicyCompliance=} [properties] Properties to set + */ + function OSPolicyCompliance(properties) { + this.osPolicyResourceCompliances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyCompliance osPolicyId. + * @member {string} osPolicyId + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @instance + */ + OSPolicyCompliance.prototype.osPolicyId = ""; + + /** + * OSPolicyCompliance complianceState. + * @member {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState} complianceState + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @instance + */ + OSPolicyCompliance.prototype.complianceState = 0; + + /** + * OSPolicyCompliance complianceStateReason. + * @member {string} complianceStateReason + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @instance + */ + OSPolicyCompliance.prototype.complianceStateReason = ""; + + /** + * OSPolicyCompliance osPolicyResourceCompliances. + * @member {Array.} osPolicyResourceCompliances + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @instance + */ + OSPolicyCompliance.prototype.osPolicyResourceCompliances = $util.emptyArray; + + /** + * Creates a new OSPolicyCompliance instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.IOSPolicyCompliance=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance} OSPolicyCompliance instance + */ + OSPolicyCompliance.create = function create(properties) { + return new OSPolicyCompliance(properties); + }; + + /** + * Encodes the specified OSPolicyCompliance message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.IOSPolicyCompliance} message OSPolicyCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyCompliance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyId != null && Object.hasOwnProperty.call(message, "osPolicyId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.osPolicyId); + if (message.complianceState != null && Object.hasOwnProperty.call(message, "complianceState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.complianceState); + if (message.complianceStateReason != null && Object.hasOwnProperty.call(message, "complianceStateReason")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.complianceStateReason); + if (message.osPolicyResourceCompliances != null && message.osPolicyResourceCompliances.length) + for (var i = 0; i < message.osPolicyResourceCompliances.length; ++i) + $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.encode(message.osPolicyResourceCompliances[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OSPolicyCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.IOSPolicyCompliance} message OSPolicyCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyCompliance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyCompliance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance} OSPolicyCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyCompliance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osPolicyId = reader.string(); + break; + } + case 2: { + message.complianceState = reader.int32(); + break; + } + case 3: { + message.complianceStateReason = reader.string(); + break; + } + case 4: { + if (!(message.osPolicyResourceCompliances && message.osPolicyResourceCompliances.length)) + message.osPolicyResourceCompliances = []; + message.osPolicyResourceCompliances.push($root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyCompliance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance} OSPolicyCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyCompliance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyCompliance message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyCompliance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osPolicyId != null && message.hasOwnProperty("osPolicyId")) + if (!$util.isString(message.osPolicyId)) + return "osPolicyId: string expected"; + if (message.complianceState != null && message.hasOwnProperty("complianceState")) + switch (message.complianceState) { + default: + return "complianceState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.complianceStateReason != null && message.hasOwnProperty("complianceStateReason")) + if (!$util.isString(message.complianceStateReason)) + return "complianceStateReason: string expected"; + if (message.osPolicyResourceCompliances != null && message.hasOwnProperty("osPolicyResourceCompliances")) { + if (!Array.isArray(message.osPolicyResourceCompliances)) + return "osPolicyResourceCompliances: array expected"; + for (var i = 0; i < message.osPolicyResourceCompliances.length; ++i) { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.verify(message.osPolicyResourceCompliances[i]); + if (error) + return "osPolicyResourceCompliances." + error; + } + } + return null; + }; + + /** + * Creates a OSPolicyCompliance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance} OSPolicyCompliance + */ + OSPolicyCompliance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance(); + if (object.osPolicyId != null) + message.osPolicyId = String(object.osPolicyId); + switch (object.complianceState) { + default: + if (typeof object.complianceState === "number") { + message.complianceState = object.complianceState; + break; + } + break; + case "UNKNOWN": + case 0: + message.complianceState = 0; + break; + case "COMPLIANT": + case 1: + message.complianceState = 1; + break; + case "NON_COMPLIANT": + case 2: + message.complianceState = 2; + break; + } + if (object.complianceStateReason != null) + message.complianceStateReason = String(object.complianceStateReason); + if (object.osPolicyResourceCompliances) { + if (!Array.isArray(object.osPolicyResourceCompliances)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.osPolicyResourceCompliances: array expected"); + message.osPolicyResourceCompliances = []; + for (var i = 0; i < object.osPolicyResourceCompliances.length; ++i) { + if (typeof object.osPolicyResourceCompliances[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.osPolicyResourceCompliances: object expected"); + message.osPolicyResourceCompliances[i] = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.fromObject(object.osPolicyResourceCompliances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a OSPolicyCompliance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance} message OSPolicyCompliance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyCompliance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicyResourceCompliances = []; + if (options.defaults) { + object.osPolicyId = ""; + object.complianceState = options.enums === String ? "UNKNOWN" : 0; + object.complianceStateReason = ""; + } + if (message.osPolicyId != null && message.hasOwnProperty("osPolicyId")) + object.osPolicyId = message.osPolicyId; + if (message.complianceState != null && message.hasOwnProperty("complianceState")) + object.complianceState = options.enums === String ? $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState[message.complianceState] === undefined ? message.complianceState : $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState[message.complianceState] : message.complianceState; + if (message.complianceStateReason != null && message.hasOwnProperty("complianceStateReason")) + object.complianceStateReason = message.complianceStateReason; + if (message.osPolicyResourceCompliances && message.osPolicyResourceCompliances.length) { + object.osPolicyResourceCompliances = []; + for (var j = 0; j < message.osPolicyResourceCompliances.length; ++j) + object.osPolicyResourceCompliances[j] = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.toObject(message.osPolicyResourceCompliances[j], options); + } + return object; + }; + + /** + * Converts this OSPolicyCompliance to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @instance + * @returns {Object.} JSON object + */ + OSPolicyCompliance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyCompliance + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyCompliance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance"; + }; + + /** + * ComplianceState enum. + * @name google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} COMPLIANT=1 COMPLIANT value + * @property {number} NON_COMPLIANT=2 NON_COMPLIANT value + */ + OSPolicyCompliance.ComplianceState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "COMPLIANT"] = 1; + values[valuesById[2] = "NON_COMPLIANT"] = 2; + return values; + })(); + + OSPolicyCompliance.OSPolicyResourceCompliance = (function() { + + /** + * Properties of a OSPolicyResourceCompliance. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @interface IOSPolicyResourceCompliance + * @property {string|null} [osPolicyResourceId] OSPolicyResourceCompliance osPolicyResourceId + * @property {Array.|null} [configSteps] OSPolicyResourceCompliance configSteps + * @property {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState|null} [complianceState] OSPolicyResourceCompliance complianceState + * @property {string|null} [complianceStateReason] OSPolicyResourceCompliance complianceStateReason + * @property {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput|null} [execResourceOutput] OSPolicyResourceCompliance execResourceOutput + */ + + /** + * Constructs a new OSPolicyResourceCompliance. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance + * @classdesc Represents a OSPolicyResourceCompliance. + * @implements IOSPolicyResourceCompliance + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance=} [properties] Properties to set + */ + function OSPolicyResourceCompliance(properties) { + this.configSteps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyResourceCompliance osPolicyResourceId. + * @member {string} osPolicyResourceId + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.osPolicyResourceId = ""; + + /** + * OSPolicyResourceCompliance configSteps. + * @member {Array.} configSteps + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.configSteps = $util.emptyArray; + + /** + * OSPolicyResourceCompliance complianceState. + * @member {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState} complianceState + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.complianceState = 0; + + /** + * OSPolicyResourceCompliance complianceStateReason. + * @member {string} complianceStateReason + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.complianceStateReason = ""; + + /** + * OSPolicyResourceCompliance execResourceOutput. + * @member {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput|null|undefined} execResourceOutput + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.execResourceOutput = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OSPolicyResourceCompliance output. + * @member {"execResourceOutput"|undefined} output + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + */ + Object.defineProperty(OSPolicyResourceCompliance.prototype, "output", { + get: $util.oneOfGetter($oneOfFields = ["execResourceOutput"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OSPolicyResourceCompliance instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance} OSPolicyResourceCompliance instance + */ + OSPolicyResourceCompliance.create = function create(properties) { + return new OSPolicyResourceCompliance(properties); + }; + + /** + * Encodes the specified OSPolicyResourceCompliance message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance} message OSPolicyResourceCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyResourceCompliance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyResourceId != null && Object.hasOwnProperty.call(message, "osPolicyResourceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.osPolicyResourceId); + if (message.configSteps != null && message.configSteps.length) + for (var i = 0; i < message.configSteps.length; ++i) + $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.encode(message.configSteps[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.complianceState != null && Object.hasOwnProperty.call(message, "complianceState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.complianceState); + if (message.complianceStateReason != null && Object.hasOwnProperty.call(message, "complianceStateReason")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.complianceStateReason); + if (message.execResourceOutput != null && Object.hasOwnProperty.call(message, "execResourceOutput")) + $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.encode(message.execResourceOutput, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OSPolicyResourceCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance} message OSPolicyResourceCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyResourceCompliance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyResourceCompliance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance} OSPolicyResourceCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyResourceCompliance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osPolicyResourceId = reader.string(); + break; + } + case 2: { + if (!(message.configSteps && message.configSteps.length)) + message.configSteps = []; + message.configSteps.push($root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.decode(reader, reader.uint32())); + break; + } + case 3: { + message.complianceState = reader.int32(); + break; + } + case 4: { + message.complianceStateReason = reader.string(); + break; + } + case 5: { + message.execResourceOutput = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyResourceCompliance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance} OSPolicyResourceCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyResourceCompliance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyResourceCompliance message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyResourceCompliance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.osPolicyResourceId != null && message.hasOwnProperty("osPolicyResourceId")) + if (!$util.isString(message.osPolicyResourceId)) + return "osPolicyResourceId: string expected"; + if (message.configSteps != null && message.hasOwnProperty("configSteps")) { + if (!Array.isArray(message.configSteps)) + return "configSteps: array expected"; + for (var i = 0; i < message.configSteps.length; ++i) { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.verify(message.configSteps[i]); + if (error) + return "configSteps." + error; + } + } + if (message.complianceState != null && message.hasOwnProperty("complianceState")) + switch (message.complianceState) { + default: + return "complianceState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.complianceStateReason != null && message.hasOwnProperty("complianceStateReason")) + if (!$util.isString(message.complianceStateReason)) + return "complianceStateReason: string expected"; + if (message.execResourceOutput != null && message.hasOwnProperty("execResourceOutput")) { + properties.output = 1; + { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.verify(message.execResourceOutput); + if (error) + return "execResourceOutput." + error; + } + } + return null; + }; + + /** + * Creates a OSPolicyResourceCompliance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance} OSPolicyResourceCompliance + */ + OSPolicyResourceCompliance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance(); + if (object.osPolicyResourceId != null) + message.osPolicyResourceId = String(object.osPolicyResourceId); + if (object.configSteps) { + if (!Array.isArray(object.configSteps)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.configSteps: array expected"); + message.configSteps = []; + for (var i = 0; i < object.configSteps.length; ++i) { + if (typeof object.configSteps[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.configSteps: object expected"); + message.configSteps[i] = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.fromObject(object.configSteps[i]); + } + } + switch (object.complianceState) { + default: + if (typeof object.complianceState === "number") { + message.complianceState = object.complianceState; + break; + } + break; + case "UNKNOWN": + case 0: + message.complianceState = 0; + break; + case "COMPLIANT": + case 1: + message.complianceState = 1; + break; + case "NON_COMPLIANT": + case 2: + message.complianceState = 2; + break; + } + if (object.complianceStateReason != null) + message.complianceStateReason = String(object.complianceStateReason); + if (object.execResourceOutput != null) { + if (typeof object.execResourceOutput !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.execResourceOutput: object expected"); + message.execResourceOutput = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.fromObject(object.execResourceOutput); + } + return message; + }; + + /** + * Creates a plain object from a OSPolicyResourceCompliance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance} message OSPolicyResourceCompliance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyResourceCompliance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.configSteps = []; + if (options.defaults) { + object.osPolicyResourceId = ""; + object.complianceState = options.enums === String ? "UNKNOWN" : 0; + object.complianceStateReason = ""; + } + if (message.osPolicyResourceId != null && message.hasOwnProperty("osPolicyResourceId")) + object.osPolicyResourceId = message.osPolicyResourceId; + if (message.configSteps && message.configSteps.length) { + object.configSteps = []; + for (var j = 0; j < message.configSteps.length; ++j) + object.configSteps[j] = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.toObject(message.configSteps[j], options); + } + if (message.complianceState != null && message.hasOwnProperty("complianceState")) + object.complianceState = options.enums === String ? $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState[message.complianceState] === undefined ? message.complianceState : $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState[message.complianceState] : message.complianceState; + if (message.complianceStateReason != null && message.hasOwnProperty("complianceStateReason")) + object.complianceStateReason = message.complianceStateReason; + if (message.execResourceOutput != null && message.hasOwnProperty("execResourceOutput")) { + object.execResourceOutput = $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.toObject(message.execResourceOutput, options); + if (options.oneofs) + object.output = "execResourceOutput"; + } + return object; + }; + + /** + * Converts this OSPolicyResourceCompliance to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + * @returns {Object.} JSON object + */ + OSPolicyResourceCompliance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyResourceCompliance + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyResourceCompliance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance"; + }; + + OSPolicyResourceCompliance.OSPolicyResourceConfigStep = (function() { + + /** + * Properties of a OSPolicyResourceConfigStep. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @interface IOSPolicyResourceConfigStep + * @property {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type|null} [type] OSPolicyResourceConfigStep type + * @property {string|null} [errorMessage] OSPolicyResourceConfigStep errorMessage + */ + + /** + * Constructs a new OSPolicyResourceConfigStep. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @classdesc Represents a OSPolicyResourceConfigStep. + * @implements IOSPolicyResourceConfigStep + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep=} [properties] Properties to set + */ + function OSPolicyResourceConfigStep(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyResourceConfigStep type. + * @member {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type} type + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @instance + */ + OSPolicyResourceConfigStep.prototype.type = 0; + + /** + * OSPolicyResourceConfigStep errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @instance + */ + OSPolicyResourceConfigStep.prototype.errorMessage = ""; + + /** + * Creates a new OSPolicyResourceConfigStep instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep} OSPolicyResourceConfigStep instance + */ + OSPolicyResourceConfigStep.create = function create(properties) { + return new OSPolicyResourceConfigStep(properties); + }; + + /** + * Encodes the specified OSPolicyResourceConfigStep message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep} message OSPolicyResourceConfigStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyResourceConfigStep.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage); + return writer; + }; + + /** + * Encodes the specified OSPolicyResourceConfigStep message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep} message OSPolicyResourceConfigStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyResourceConfigStep.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyResourceConfigStep message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep} OSPolicyResourceConfigStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyResourceConfigStep.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.errorMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyResourceConfigStep message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep} OSPolicyResourceConfigStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyResourceConfigStep.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyResourceConfigStep message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyResourceConfigStep.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + return null; + }; + + /** + * Creates a OSPolicyResourceConfigStep message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep} OSPolicyResourceConfigStep + */ + OSPolicyResourceConfigStep.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "VALIDATION": + case 1: + message.type = 1; + break; + case "DESIRED_STATE_CHECK": + case 2: + message.type = 2; + break; + case "DESIRED_STATE_ENFORCEMENT": + case 3: + message.type = 3; + break; + case "DESIRED_STATE_CHECK_POST_ENFORCEMENT": + case 4: + message.type = 4; + break; + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + return message; + }; + + /** + * Creates a plain object from a OSPolicyResourceConfigStep message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep} message OSPolicyResourceConfigStep + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyResourceConfigStep.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.errorMessage = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type[message.type] === undefined ? message.type : $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type[message.type] : message.type; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + return object; + }; + + /** + * Converts this OSPolicyResourceConfigStep to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @instance + * @returns {Object.} JSON object + */ + OSPolicyResourceConfigStep.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyResourceConfigStep + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyResourceConfigStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep"; + }; + + /** + * Type enum. + * @name google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} VALIDATION=1 VALIDATION value + * @property {number} DESIRED_STATE_CHECK=2 DESIRED_STATE_CHECK value + * @property {number} DESIRED_STATE_ENFORCEMENT=3 DESIRED_STATE_ENFORCEMENT value + * @property {number} DESIRED_STATE_CHECK_POST_ENFORCEMENT=4 DESIRED_STATE_CHECK_POST_ENFORCEMENT value + */ + OSPolicyResourceConfigStep.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VALIDATION"] = 1; + values[valuesById[2] = "DESIRED_STATE_CHECK"] = 2; + values[valuesById[3] = "DESIRED_STATE_ENFORCEMENT"] = 3; + values[valuesById[4] = "DESIRED_STATE_CHECK_POST_ENFORCEMENT"] = 4; + return values; + })(); + + return OSPolicyResourceConfigStep; + })(); + + /** + * ComplianceState enum. + * @name google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} COMPLIANT=1 COMPLIANT value + * @property {number} NON_COMPLIANT=2 NON_COMPLIANT value + */ + OSPolicyResourceCompliance.ComplianceState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "COMPLIANT"] = 1; + values[valuesById[2] = "NON_COMPLIANT"] = 2; + return values; + })(); + + OSPolicyResourceCompliance.ExecResourceOutput = (function() { + + /** + * Properties of an ExecResourceOutput. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @interface IExecResourceOutput + * @property {Uint8Array|null} [enforcementOutput] ExecResourceOutput enforcementOutput + */ + + /** + * Constructs a new ExecResourceOutput. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @classdesc Represents an ExecResourceOutput. + * @implements IExecResourceOutput + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput=} [properties] Properties to set + */ + function ExecResourceOutput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecResourceOutput enforcementOutput. + * @member {Uint8Array} enforcementOutput + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @instance + */ + ExecResourceOutput.prototype.enforcementOutput = $util.newBuffer([]); + + /** + * Creates a new ExecResourceOutput instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput} ExecResourceOutput instance + */ + ExecResourceOutput.create = function create(properties) { + return new ExecResourceOutput(properties); + }; + + /** + * Encodes the specified ExecResourceOutput message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput} message ExecResourceOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecResourceOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enforcementOutput != null && Object.hasOwnProperty.call(message, "enforcementOutput")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.enforcementOutput); + return writer; + }; + + /** + * Encodes the specified ExecResourceOutput message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput} message ExecResourceOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecResourceOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecResourceOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput} ExecResourceOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecResourceOutput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.enforcementOutput = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecResourceOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput} ExecResourceOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecResourceOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecResourceOutput message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecResourceOutput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enforcementOutput != null && message.hasOwnProperty("enforcementOutput")) + if (!(message.enforcementOutput && typeof message.enforcementOutput.length === "number" || $util.isString(message.enforcementOutput))) + return "enforcementOutput: buffer expected"; + return null; + }; + + /** + * Creates an ExecResourceOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput} ExecResourceOutput + */ + ExecResourceOutput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput(); + if (object.enforcementOutput != null) + if (typeof object.enforcementOutput === "string") + $util.base64.decode(object.enforcementOutput, message.enforcementOutput = $util.newBuffer($util.base64.length(object.enforcementOutput)), 0); + else if (object.enforcementOutput.length >= 0) + message.enforcementOutput = object.enforcementOutput; + return message; + }; + + /** + * Creates a plain object from an ExecResourceOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput} message ExecResourceOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecResourceOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.enforcementOutput = ""; + else { + object.enforcementOutput = []; + if (options.bytes !== Array) + object.enforcementOutput = $util.newBuffer(object.enforcementOutput); + } + if (message.enforcementOutput != null && message.hasOwnProperty("enforcementOutput")) + object.enforcementOutput = options.bytes === String ? $util.base64.encode(message.enforcementOutput, 0, message.enforcementOutput.length) : options.bytes === Array ? Array.prototype.slice.call(message.enforcementOutput) : message.enforcementOutput; + return object; + }; + + /** + * Converts this ExecResourceOutput to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @instance + * @returns {Object.} JSON object + */ + ExecResourceOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecResourceOutput + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecResourceOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput"; + }; + + return ExecResourceOutput; + })(); + + return OSPolicyResourceCompliance; + })(); + + return OSPolicyCompliance; + })(); + + return OSPolicyAssignmentReport; + })(); + + v1.OSPolicyAssignment = (function() { + + /** + * Properties of a OSPolicyAssignment. + * @memberof google.cloud.osconfig.v1 + * @interface IOSPolicyAssignment + * @property {string|null} [name] OSPolicyAssignment name + * @property {string|null} [description] OSPolicyAssignment description + * @property {Array.|null} [osPolicies] OSPolicyAssignment osPolicies + * @property {google.cloud.osconfig.v1.OSPolicyAssignment.IInstanceFilter|null} [instanceFilter] OSPolicyAssignment instanceFilter + * @property {google.cloud.osconfig.v1.OSPolicyAssignment.IRollout|null} [rollout] OSPolicyAssignment rollout + * @property {string|null} [revisionId] OSPolicyAssignment revisionId + * @property {google.protobuf.ITimestamp|null} [revisionCreateTime] OSPolicyAssignment revisionCreateTime + * @property {string|null} [etag] OSPolicyAssignment etag + * @property {google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState|null} [rolloutState] OSPolicyAssignment rolloutState + * @property {boolean|null} [baseline] OSPolicyAssignment baseline + * @property {boolean|null} [deleted] OSPolicyAssignment deleted + * @property {boolean|null} [reconciling] OSPolicyAssignment reconciling + * @property {string|null} [uid] OSPolicyAssignment uid + */ + + /** + * Constructs a new OSPolicyAssignment. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a OSPolicyAssignment. + * @implements IOSPolicyAssignment + * @constructor + * @param {google.cloud.osconfig.v1.IOSPolicyAssignment=} [properties] Properties to set + */ + function OSPolicyAssignment(properties) { + this.osPolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyAssignment name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.name = ""; + + /** + * OSPolicyAssignment description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.description = ""; + + /** + * OSPolicyAssignment osPolicies. + * @member {Array.} osPolicies + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.osPolicies = $util.emptyArray; + + /** + * OSPolicyAssignment instanceFilter. + * @member {google.cloud.osconfig.v1.OSPolicyAssignment.IInstanceFilter|null|undefined} instanceFilter + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.instanceFilter = null; + + /** + * OSPolicyAssignment rollout. + * @member {google.cloud.osconfig.v1.OSPolicyAssignment.IRollout|null|undefined} rollout + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.rollout = null; + + /** + * OSPolicyAssignment revisionId. + * @member {string} revisionId + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.revisionId = ""; + + /** + * OSPolicyAssignment revisionCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} revisionCreateTime + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.revisionCreateTime = null; + + /** + * OSPolicyAssignment etag. + * @member {string} etag + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.etag = ""; + + /** + * OSPolicyAssignment rolloutState. + * @member {google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState} rolloutState + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.rolloutState = 0; + + /** + * OSPolicyAssignment baseline. + * @member {boolean} baseline + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.baseline = false; + + /** + * OSPolicyAssignment deleted. + * @member {boolean} deleted + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.deleted = false; + + /** + * OSPolicyAssignment reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.reconciling = false; + + /** + * OSPolicyAssignment uid. + * @member {string} uid + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.uid = ""; + + /** + * Creates a new OSPolicyAssignment instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @static + * @param {google.cloud.osconfig.v1.IOSPolicyAssignment=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment} OSPolicyAssignment instance + */ + OSPolicyAssignment.create = function create(properties) { + return new OSPolicyAssignment(properties); + }; + + /** + * Encodes the specified OSPolicyAssignment message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @static + * @param {google.cloud.osconfig.v1.IOSPolicyAssignment} message OSPolicyAssignment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyAssignment.encode = function encode(message, writer) { + if (!writer) + 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.osPolicies != null && message.osPolicies.length) + for (var i = 0; i < message.osPolicies.length; ++i) + $root.google.cloud.osconfig.v1.OSPolicy.encode(message.osPolicies[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.instanceFilter != null && Object.hasOwnProperty.call(message, "instanceFilter")) + $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.encode(message.instanceFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + $root.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout.encode(message.rollout, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.revisionId); + if (message.revisionCreateTime != null && Object.hasOwnProperty.call(message, "revisionCreateTime")) + $root.google.protobuf.Timestamp.encode(message.revisionCreateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.etag); + if (message.rolloutState != null && Object.hasOwnProperty.call(message, "rolloutState")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.rolloutState); + if (message.baseline != null && Object.hasOwnProperty.call(message, "baseline")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.baseline); + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deleted); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.reconciling); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.uid); + return writer; + }; + + /** + * Encodes the specified OSPolicyAssignment message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @static + * @param {google.cloud.osconfig.v1.IOSPolicyAssignment} message OSPolicyAssignment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyAssignment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyAssignment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment} OSPolicyAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyAssignment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicyAssignment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + if (!(message.osPolicies && message.osPolicies.length)) + message.osPolicies = []; + message.osPolicies.push($root.google.cloud.osconfig.v1.OSPolicy.decode(reader, reader.uint32())); + break; + } + case 4: { + message.instanceFilter = $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.rollout = $root.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout.decode(reader, reader.uint32()); + break; + } + case 6: { + message.revisionId = reader.string(); + break; + } + case 7: { + message.revisionCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.etag = reader.string(); + break; + } + case 9: { + message.rolloutState = reader.int32(); + break; + } + case 10: { + message.baseline = reader.bool(); + break; + } + case 11: { + message.deleted = reader.bool(); + break; + } + case 12: { + message.reconciling = reader.bool(); + break; + } + case 13: { + message.uid = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyAssignment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment} OSPolicyAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyAssignment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyAssignment message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyAssignment.verify = function verify(message) { + if (typeof message !== "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.osPolicies != null && message.hasOwnProperty("osPolicies")) { + if (!Array.isArray(message.osPolicies)) + return "osPolicies: array expected"; + for (var i = 0; i < message.osPolicies.length; ++i) { + var error = $root.google.cloud.osconfig.v1.OSPolicy.verify(message.osPolicies[i]); + if (error) + return "osPolicies." + error; + } + } + if (message.instanceFilter != null && message.hasOwnProperty("instanceFilter")) { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.verify(message.instanceFilter); + if (error) + return "instanceFilter." + error; + } + if (message.rollout != null && message.hasOwnProperty("rollout")) { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout.verify(message.rollout); + if (error) + return "rollout." + error; + } + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revisionCreateTime); + if (error) + return "revisionCreateTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.rolloutState != null && message.hasOwnProperty("rolloutState")) + switch (message.rolloutState) { + default: + return "rolloutState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.baseline != null && message.hasOwnProperty("baseline")) + if (typeof message.baseline !== "boolean") + return "baseline: boolean expected"; + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + return null; + }; + + /** + * Creates a OSPolicyAssignment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment} OSPolicyAssignment + */ + OSPolicyAssignment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicyAssignment) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicyAssignment(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.osPolicies) { + if (!Array.isArray(object.osPolicies)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.osPolicies: array expected"); + message.osPolicies = []; + for (var i = 0; i < object.osPolicies.length; ++i) { + if (typeof object.osPolicies[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.osPolicies: object expected"); + message.osPolicies[i] = $root.google.cloud.osconfig.v1.OSPolicy.fromObject(object.osPolicies[i]); + } + } + if (object.instanceFilter != null) { + if (typeof object.instanceFilter !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.instanceFilter: object expected"); + message.instanceFilter = $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.fromObject(object.instanceFilter); + } + if (object.rollout != null) { + if (typeof object.rollout !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.rollout: object expected"); + message.rollout = $root.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout.fromObject(object.rollout); + } + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.revisionCreateTime != null) { + if (typeof object.revisionCreateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.revisionCreateTime: object expected"); + message.revisionCreateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionCreateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + switch (object.rolloutState) { + default: + if (typeof object.rolloutState === "number") { + message.rolloutState = object.rolloutState; + break; + } + break; + case "ROLLOUT_STATE_UNSPECIFIED": + case 0: + message.rolloutState = 0; + break; + case "IN_PROGRESS": + case 1: + message.rolloutState = 1; + break; + case "CANCELLING": + case 2: + message.rolloutState = 2; + break; + case "CANCELLED": + case 3: + message.rolloutState = 3; + break; + case "SUCCEEDED": + case 4: + message.rolloutState = 4; + break; + } + if (object.baseline != null) + message.baseline = Boolean(object.baseline); + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.uid != null) + message.uid = String(object.uid); + return message; + }; + + /** + * Creates a plain object from a OSPolicyAssignment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment} message OSPolicyAssignment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyAssignment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicies = []; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.instanceFilter = null; + object.rollout = null; + object.revisionId = ""; + object.revisionCreateTime = null; + object.etag = ""; + object.rolloutState = options.enums === String ? "ROLLOUT_STATE_UNSPECIFIED" : 0; + object.baseline = false; + object.deleted = false; + object.reconciling = false; + object.uid = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.osPolicies && message.osPolicies.length) { + object.osPolicies = []; + for (var j = 0; j < message.osPolicies.length; ++j) + object.osPolicies[j] = $root.google.cloud.osconfig.v1.OSPolicy.toObject(message.osPolicies[j], options); + } + if (message.instanceFilter != null && message.hasOwnProperty("instanceFilter")) + object.instanceFilter = $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.toObject(message.instanceFilter, options); + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = $root.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout.toObject(message.rollout, options); + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) + object.revisionCreateTime = $root.google.protobuf.Timestamp.toObject(message.revisionCreateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.rolloutState != null && message.hasOwnProperty("rolloutState")) + object.rolloutState = options.enums === String ? $root.google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState[message.rolloutState] === undefined ? message.rolloutState : $root.google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState[message.rolloutState] : message.rolloutState; + if (message.baseline != null && message.hasOwnProperty("baseline")) + object.baseline = message.baseline; + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + return object; + }; + + /** + * Converts this OSPolicyAssignment to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @instance + * @returns {Object.} JSON object + */ + OSPolicyAssignment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyAssignment + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyAssignment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicyAssignment"; + }; + + OSPolicyAssignment.LabelSet = (function() { + + /** + * Properties of a LabelSet. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @interface ILabelSet + * @property {Object.|null} [labels] LabelSet labels + */ + + /** + * Constructs a new LabelSet. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @classdesc Represents a LabelSet. + * @implements ILabelSet + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.ILabelSet=} [properties] Properties to set + */ + function LabelSet(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]]; + } + + /** + * LabelSet labels. + * @member {Object.} labels + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet + * @instance + */ + LabelSet.prototype.labels = $util.emptyObject; + + /** + * Creates a new LabelSet instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.ILabelSet=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet} LabelSet instance + */ + LabelSet.create = function create(properties) { + return new LabelSet(properties); + }; + + /** + * Encodes the specified LabelSet message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.ILabelSet} message LabelSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelSet message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.ILabelSet} message LabelSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet} LabelSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet} LabelSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelSet message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a LabelSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet} LabelSet + */ + LabelSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a LabelSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet} message LabelSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this LabelSet to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet + * @instance + * @returns {Object.} JSON object + */ + LabelSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelSet + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet"; + }; + + return LabelSet; + })(); + + OSPolicyAssignment.InstanceFilter = (function() { + + /** + * Properties of an InstanceFilter. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @interface IInstanceFilter + * @property {boolean|null} [all] InstanceFilter all + * @property {Array.|null} [inclusionLabels] InstanceFilter inclusionLabels + * @property {Array.|null} [exclusionLabels] InstanceFilter exclusionLabels + * @property {Array.|null} [inventories] InstanceFilter inventories + */ + + /** + * Constructs a new InstanceFilter. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @classdesc Represents an InstanceFilter. + * @implements IInstanceFilter + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.IInstanceFilter=} [properties] Properties to set + */ + function InstanceFilter(properties) { + this.inclusionLabels = []; + this.exclusionLabels = []; + this.inventories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceFilter all. + * @member {boolean} all + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @instance + */ + InstanceFilter.prototype.all = false; + + /** + * InstanceFilter inclusionLabels. + * @member {Array.} inclusionLabels + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @instance + */ + InstanceFilter.prototype.inclusionLabels = $util.emptyArray; + + /** + * InstanceFilter exclusionLabels. + * @member {Array.} exclusionLabels + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @instance + */ + InstanceFilter.prototype.exclusionLabels = $util.emptyArray; + + /** + * InstanceFilter inventories. + * @member {Array.} inventories + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @instance + */ + InstanceFilter.prototype.inventories = $util.emptyArray; + + /** + * Creates a new InstanceFilter instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.IInstanceFilter=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter} InstanceFilter instance + */ + InstanceFilter.create = function create(properties) { + return new InstanceFilter(properties); + }; + + /** + * Encodes the specified InstanceFilter message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.IInstanceFilter} message InstanceFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.all != null && Object.hasOwnProperty.call(message, "all")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.all); + if (message.inclusionLabels != null && message.inclusionLabels.length) + for (var i = 0; i < message.inclusionLabels.length; ++i) + $root.google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.encode(message.inclusionLabels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.exclusionLabels != null && message.exclusionLabels.length) + for (var i = 0; i < message.exclusionLabels.length; ++i) + $root.google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.encode(message.exclusionLabels[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.inventories != null && message.inventories.length) + for (var i = 0; i < message.inventories.length; ++i) + $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory.encode(message.inventories[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceFilter message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.IInstanceFilter} message InstanceFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter} InstanceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.all = reader.bool(); + break; + } + case 2: { + if (!(message.inclusionLabels && message.inclusionLabels.length)) + message.inclusionLabels = []; + message.inclusionLabels.push($root.google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.exclusionLabels && message.exclusionLabels.length)) + message.exclusionLabels = []; + message.exclusionLabels.push($root.google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.inventories && message.inventories.length)) + message.inventories = []; + message.inventories.push($root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter} InstanceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceFilter message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.all != null && message.hasOwnProperty("all")) + if (typeof message.all !== "boolean") + return "all: boolean expected"; + if (message.inclusionLabels != null && message.hasOwnProperty("inclusionLabels")) { + if (!Array.isArray(message.inclusionLabels)) + return "inclusionLabels: array expected"; + for (var i = 0; i < message.inclusionLabels.length; ++i) { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.verify(message.inclusionLabels[i]); + if (error) + return "inclusionLabels." + error; + } + } + if (message.exclusionLabels != null && message.hasOwnProperty("exclusionLabels")) { + if (!Array.isArray(message.exclusionLabels)) + return "exclusionLabels: array expected"; + for (var i = 0; i < message.exclusionLabels.length; ++i) { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.verify(message.exclusionLabels[i]); + if (error) + return "exclusionLabels." + error; + } + } + if (message.inventories != null && message.hasOwnProperty("inventories")) { + if (!Array.isArray(message.inventories)) + return "inventories: array expected"; + for (var i = 0; i < message.inventories.length; ++i) { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory.verify(message.inventories[i]); + if (error) + return "inventories." + error; + } + } + return null; + }; + + /** + * Creates an InstanceFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter} InstanceFilter + */ + InstanceFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter(); + if (object.all != null) + message.all = Boolean(object.all); + if (object.inclusionLabels) { + if (!Array.isArray(object.inclusionLabels)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.inclusionLabels: array expected"); + message.inclusionLabels = []; + for (var i = 0; i < object.inclusionLabels.length; ++i) { + if (typeof object.inclusionLabels[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.inclusionLabels: object expected"); + message.inclusionLabels[i] = $root.google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.fromObject(object.inclusionLabels[i]); + } + } + if (object.exclusionLabels) { + if (!Array.isArray(object.exclusionLabels)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.exclusionLabels: array expected"); + message.exclusionLabels = []; + for (var i = 0; i < object.exclusionLabels.length; ++i) { + if (typeof object.exclusionLabels[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.exclusionLabels: object expected"); + message.exclusionLabels[i] = $root.google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.fromObject(object.exclusionLabels[i]); + } + } + if (object.inventories) { + if (!Array.isArray(object.inventories)) + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.inventories: array expected"); + message.inventories = []; + for (var i = 0; i < object.inventories.length; ++i) { + if (typeof object.inventories[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.inventories: object expected"); + message.inventories[i] = $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory.fromObject(object.inventories[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InstanceFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter} message InstanceFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inclusionLabels = []; + object.exclusionLabels = []; + object.inventories = []; + } + if (options.defaults) + object.all = false; + if (message.all != null && message.hasOwnProperty("all")) + object.all = message.all; + if (message.inclusionLabels && message.inclusionLabels.length) { + object.inclusionLabels = []; + for (var j = 0; j < message.inclusionLabels.length; ++j) + object.inclusionLabels[j] = $root.google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.toObject(message.inclusionLabels[j], options); + } + if (message.exclusionLabels && message.exclusionLabels.length) { + object.exclusionLabels = []; + for (var j = 0; j < message.exclusionLabels.length; ++j) + object.exclusionLabels[j] = $root.google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet.toObject(message.exclusionLabels[j], options); + } + if (message.inventories && message.inventories.length) { + object.inventories = []; + for (var j = 0; j < message.inventories.length; ++j) + object.inventories[j] = $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory.toObject(message.inventories[j], options); + } + return object; + }; + + /** + * Converts this InstanceFilter to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @instance + * @returns {Object.} JSON object + */ + InstanceFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceFilter + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter"; + }; + + InstanceFilter.Inventory = (function() { + + /** + * Properties of an Inventory. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @interface IInventory + * @property {string|null} [osShortName] Inventory osShortName + * @property {string|null} [osVersion] Inventory osVersion + */ + + /** + * Constructs a new Inventory. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter + * @classdesc Represents an Inventory. + * @implements IInventory + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.IInventory=} [properties] Properties to set + */ + function Inventory(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Inventory osShortName. + * @member {string} osShortName + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory + * @instance + */ + Inventory.prototype.osShortName = ""; + + /** + * Inventory osVersion. + * @member {string} osVersion + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory + * @instance + */ + Inventory.prototype.osVersion = ""; + + /** + * Creates a new Inventory instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.IInventory=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory} Inventory instance + */ + Inventory.create = function create(properties) { + return new Inventory(properties); + }; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osShortName != null && Object.hasOwnProperty.call(message, "osShortName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.osShortName); + if (message.osVersion != null && Object.hasOwnProperty.call(message, "osVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.osVersion); + return writer; + }; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osShortName = reader.string(); + break; + } + case 2: { + message.osVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Inventory message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Inventory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osShortName != null && message.hasOwnProperty("osShortName")) + if (!$util.isString(message.osShortName)) + return "osShortName: string expected"; + if (message.osVersion != null && message.hasOwnProperty("osVersion")) + if (!$util.isString(message.osVersion)) + return "osVersion: string expected"; + return null; + }; + + /** + * Creates an Inventory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory} Inventory + */ + Inventory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory(); + if (object.osShortName != null) + message.osShortName = String(object.osShortName); + if (object.osVersion != null) + message.osVersion = String(object.osVersion); + return message; + }; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory} message Inventory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Inventory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osShortName = ""; + object.osVersion = ""; + } + if (message.osShortName != null && message.hasOwnProperty("osShortName")) + object.osShortName = message.osShortName; + if (message.osVersion != null && message.hasOwnProperty("osVersion")) + object.osVersion = message.osVersion; + return object; + }; + + /** + * Converts this Inventory to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory + * @instance + * @returns {Object.} JSON object + */ + Inventory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Inventory + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Inventory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter.Inventory"; + }; + + return Inventory; + })(); + + return InstanceFilter; + })(); + + OSPolicyAssignment.Rollout = (function() { + + /** + * Properties of a Rollout. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @interface IRollout + * @property {google.cloud.osconfig.v1.IFixedOrPercent|null} [disruptionBudget] Rollout disruptionBudget + * @property {google.protobuf.IDuration|null} [minWaitDuration] Rollout minWaitDuration + */ + + /** + * Constructs a new Rollout. + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment + * @classdesc Represents a Rollout. + * @implements IRollout + * @constructor + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.IRollout=} [properties] Properties to set + */ + function Rollout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Rollout disruptionBudget. + * @member {google.cloud.osconfig.v1.IFixedOrPercent|null|undefined} disruptionBudget + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.Rollout + * @instance + */ + Rollout.prototype.disruptionBudget = null; + + /** + * Rollout minWaitDuration. + * @member {google.protobuf.IDuration|null|undefined} minWaitDuration + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.Rollout + * @instance + */ + Rollout.prototype.minWaitDuration = null; + + /** + * Creates a new Rollout instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.Rollout + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.IRollout=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.Rollout} Rollout instance + */ + Rollout.create = function create(properties) { + return new Rollout(properties); + }; + + /** + * Encodes the specified Rollout message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.Rollout.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.Rollout + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.IRollout} message Rollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rollout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disruptionBudget != null && Object.hasOwnProperty.call(message, "disruptionBudget")) + $root.google.cloud.osconfig.v1.FixedOrPercent.encode(message.disruptionBudget, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minWaitDuration != null && Object.hasOwnProperty.call(message, "minWaitDuration")) + $root.google.protobuf.Duration.encode(message.minWaitDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Rollout message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignment.Rollout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.Rollout + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.IRollout} message Rollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rollout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Rollout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.Rollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.Rollout} Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rollout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.disruptionBudget = $root.google.cloud.osconfig.v1.FixedOrPercent.decode(reader, reader.uint32()); + break; + } + case 2: { + message.minWaitDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Rollout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.Rollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.Rollout} Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rollout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Rollout message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.Rollout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Rollout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disruptionBudget != null && message.hasOwnProperty("disruptionBudget")) { + var error = $root.google.cloud.osconfig.v1.FixedOrPercent.verify(message.disruptionBudget); + if (error) + return "disruptionBudget." + error; + } + if (message.minWaitDuration != null && message.hasOwnProperty("minWaitDuration")) { + var error = $root.google.protobuf.Duration.verify(message.minWaitDuration); + if (error) + return "minWaitDuration." + error; + } + return null; + }; + + /** + * Creates a Rollout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.Rollout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicyAssignment.Rollout} Rollout + */ + Rollout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout(); + if (object.disruptionBudget != null) { + if (typeof object.disruptionBudget !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.Rollout.disruptionBudget: object expected"); + message.disruptionBudget = $root.google.cloud.osconfig.v1.FixedOrPercent.fromObject(object.disruptionBudget); + } + if (object.minWaitDuration != null) { + if (typeof object.minWaitDuration !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignment.Rollout.minWaitDuration: object expected"); + message.minWaitDuration = $root.google.protobuf.Duration.fromObject(object.minWaitDuration); + } + return message; + }; + + /** + * Creates a plain object from a Rollout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.Rollout + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignment.Rollout} message Rollout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Rollout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disruptionBudget = null; + object.minWaitDuration = null; + } + if (message.disruptionBudget != null && message.hasOwnProperty("disruptionBudget")) + object.disruptionBudget = $root.google.cloud.osconfig.v1.FixedOrPercent.toObject(message.disruptionBudget, options); + if (message.minWaitDuration != null && message.hasOwnProperty("minWaitDuration")) + object.minWaitDuration = $root.google.protobuf.Duration.toObject(message.minWaitDuration, options); + return object; + }; + + /** + * Converts this Rollout to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.Rollout + * @instance + * @returns {Object.} JSON object + */ + Rollout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Rollout + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicyAssignment.Rollout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Rollout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicyAssignment.Rollout"; + }; + + return Rollout; + })(); + + /** + * RolloutState enum. + * @name google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState + * @enum {number} + * @property {number} ROLLOUT_STATE_UNSPECIFIED=0 ROLLOUT_STATE_UNSPECIFIED value + * @property {number} IN_PROGRESS=1 IN_PROGRESS value + * @property {number} CANCELLING=2 CANCELLING value + * @property {number} CANCELLED=3 CANCELLED value + * @property {number} SUCCEEDED=4 SUCCEEDED value + */ + OSPolicyAssignment.RolloutState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLLOUT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_PROGRESS"] = 1; + values[valuesById[2] = "CANCELLING"] = 2; + values[valuesById[3] = "CANCELLED"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + return values; + })(); + + return OSPolicyAssignment; + })(); + + v1.OSPolicyAssignmentOperationMetadata = (function() { + + /** + * Properties of a OSPolicyAssignmentOperationMetadata. + * @memberof google.cloud.osconfig.v1 + * @interface IOSPolicyAssignmentOperationMetadata + * @property {string|null} [osPolicyAssignment] OSPolicyAssignmentOperationMetadata osPolicyAssignment + * @property {google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.APIMethod|null} [apiMethod] OSPolicyAssignmentOperationMetadata apiMethod + * @property {google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.RolloutState|null} [rolloutState] OSPolicyAssignmentOperationMetadata rolloutState + * @property {google.protobuf.ITimestamp|null} [rolloutStartTime] OSPolicyAssignmentOperationMetadata rolloutStartTime + * @property {google.protobuf.ITimestamp|null} [rolloutUpdateTime] OSPolicyAssignmentOperationMetadata rolloutUpdateTime + */ + + /** + * Constructs a new OSPolicyAssignmentOperationMetadata. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a OSPolicyAssignmentOperationMetadata. + * @implements IOSPolicyAssignmentOperationMetadata + * @constructor + * @param {google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata=} [properties] Properties to set + */ + function OSPolicyAssignmentOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyAssignmentOperationMetadata osPolicyAssignment. + * @member {string} osPolicyAssignment + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @instance + */ + OSPolicyAssignmentOperationMetadata.prototype.osPolicyAssignment = ""; + + /** + * OSPolicyAssignmentOperationMetadata apiMethod. + * @member {google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.APIMethod} apiMethod + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @instance + */ + OSPolicyAssignmentOperationMetadata.prototype.apiMethod = 0; + + /** + * OSPolicyAssignmentOperationMetadata rolloutState. + * @member {google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.RolloutState} rolloutState + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @instance + */ + OSPolicyAssignmentOperationMetadata.prototype.rolloutState = 0; + + /** + * OSPolicyAssignmentOperationMetadata rolloutStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} rolloutStartTime + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @instance + */ + OSPolicyAssignmentOperationMetadata.prototype.rolloutStartTime = null; + + /** + * OSPolicyAssignmentOperationMetadata rolloutUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} rolloutUpdateTime + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @instance + */ + OSPolicyAssignmentOperationMetadata.prototype.rolloutUpdateTime = null; + + /** + * Creates a new OSPolicyAssignmentOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @static + * @param {google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata} OSPolicyAssignmentOperationMetadata instance + */ + OSPolicyAssignmentOperationMetadata.create = function create(properties) { + return new OSPolicyAssignmentOperationMetadata(properties); + }; + + /** + * Encodes the specified OSPolicyAssignmentOperationMetadata message. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @static + * @param {google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata} message OSPolicyAssignmentOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyAssignmentOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyAssignment != null && Object.hasOwnProperty.call(message, "osPolicyAssignment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.osPolicyAssignment); + if (message.apiMethod != null && Object.hasOwnProperty.call(message, "apiMethod")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.apiMethod); + if (message.rolloutState != null && Object.hasOwnProperty.call(message, "rolloutState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.rolloutState); + if (message.rolloutStartTime != null && Object.hasOwnProperty.call(message, "rolloutStartTime")) + $root.google.protobuf.Timestamp.encode(message.rolloutStartTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rolloutUpdateTime != null && Object.hasOwnProperty.call(message, "rolloutUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.rolloutUpdateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OSPolicyAssignmentOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @static + * @param {google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata} message OSPolicyAssignmentOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyAssignmentOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyAssignmentOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata} OSPolicyAssignmentOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyAssignmentOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osPolicyAssignment = reader.string(); + break; + } + case 2: { + message.apiMethod = reader.int32(); + break; + } + case 3: { + message.rolloutState = reader.int32(); + break; + } + case 4: { + message.rolloutStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.rolloutUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyAssignmentOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata} OSPolicyAssignmentOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyAssignmentOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyAssignmentOperationMetadata message. + * @function verify + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyAssignmentOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + if (!$util.isString(message.osPolicyAssignment)) + return "osPolicyAssignment: string expected"; + if (message.apiMethod != null && message.hasOwnProperty("apiMethod")) + switch (message.apiMethod) { + default: + return "apiMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.rolloutState != null && message.hasOwnProperty("rolloutState")) + switch (message.rolloutState) { + default: + return "rolloutState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.rolloutStartTime != null && message.hasOwnProperty("rolloutStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.rolloutStartTime); + if (error) + return "rolloutStartTime." + error; + } + if (message.rolloutUpdateTime != null && message.hasOwnProperty("rolloutUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.rolloutUpdateTime); + if (error) + return "rolloutUpdateTime." + error; + } + return null; + }; + + /** + * Creates a OSPolicyAssignmentOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata} OSPolicyAssignmentOperationMetadata + */ + OSPolicyAssignmentOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata) + return object; + var message = new $root.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata(); + if (object.osPolicyAssignment != null) + message.osPolicyAssignment = String(object.osPolicyAssignment); + switch (object.apiMethod) { + default: + if (typeof object.apiMethod === "number") { + message.apiMethod = object.apiMethod; + break; + } + break; + case "API_METHOD_UNSPECIFIED": + case 0: + message.apiMethod = 0; + break; + case "CREATE": + case 1: + message.apiMethod = 1; + break; + case "UPDATE": + case 2: + message.apiMethod = 2; + break; + case "DELETE": + case 3: + message.apiMethod = 3; + break; + } + switch (object.rolloutState) { + default: + if (typeof object.rolloutState === "number") { + message.rolloutState = object.rolloutState; + break; + } + break; + case "ROLLOUT_STATE_UNSPECIFIED": + case 0: + message.rolloutState = 0; + break; + case "IN_PROGRESS": + case 1: + message.rolloutState = 1; + break; + case "CANCELLING": + case 2: + message.rolloutState = 2; + break; + case "CANCELLED": + case 3: + message.rolloutState = 3; + break; + case "SUCCEEDED": + case 4: + message.rolloutState = 4; + break; + } + if (object.rolloutStartTime != null) { + if (typeof object.rolloutStartTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.rolloutStartTime: object expected"); + message.rolloutStartTime = $root.google.protobuf.Timestamp.fromObject(object.rolloutStartTime); + } + if (object.rolloutUpdateTime != null) { + if (typeof object.rolloutUpdateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.rolloutUpdateTime: object expected"); + message.rolloutUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.rolloutUpdateTime); + } + return message; + }; + + /** + * Creates a plain object from a OSPolicyAssignmentOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @static + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata} message OSPolicyAssignmentOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyAssignmentOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osPolicyAssignment = ""; + object.apiMethod = options.enums === String ? "API_METHOD_UNSPECIFIED" : 0; + object.rolloutState = options.enums === String ? "ROLLOUT_STATE_UNSPECIFIED" : 0; + object.rolloutStartTime = null; + object.rolloutUpdateTime = null; + } + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + object.osPolicyAssignment = message.osPolicyAssignment; + if (message.apiMethod != null && message.hasOwnProperty("apiMethod")) + object.apiMethod = options.enums === String ? $root.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.APIMethod[message.apiMethod] === undefined ? message.apiMethod : $root.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.APIMethod[message.apiMethod] : message.apiMethod; + if (message.rolloutState != null && message.hasOwnProperty("rolloutState")) + object.rolloutState = options.enums === String ? $root.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.RolloutState[message.rolloutState] === undefined ? message.rolloutState : $root.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.RolloutState[message.rolloutState] : message.rolloutState; + if (message.rolloutStartTime != null && message.hasOwnProperty("rolloutStartTime")) + object.rolloutStartTime = $root.google.protobuf.Timestamp.toObject(message.rolloutStartTime, options); + if (message.rolloutUpdateTime != null && message.hasOwnProperty("rolloutUpdateTime")) + object.rolloutUpdateTime = $root.google.protobuf.Timestamp.toObject(message.rolloutUpdateTime, options); + return object; + }; + + /** + * Converts this OSPolicyAssignmentOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OSPolicyAssignmentOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyAssignmentOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyAssignmentOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata"; + }; + + /** + * APIMethod enum. + * @name google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.APIMethod + * @enum {number} + * @property {number} API_METHOD_UNSPECIFIED=0 API_METHOD_UNSPECIFIED value + * @property {number} CREATE=1 CREATE value + * @property {number} UPDATE=2 UPDATE value + * @property {number} DELETE=3 DELETE value + */ + OSPolicyAssignmentOperationMetadata.APIMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "API_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATE"] = 1; + values[valuesById[2] = "UPDATE"] = 2; + values[valuesById[3] = "DELETE"] = 3; + return values; + })(); + + /** + * RolloutState enum. + * @name google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata.RolloutState + * @enum {number} + * @property {number} ROLLOUT_STATE_UNSPECIFIED=0 ROLLOUT_STATE_UNSPECIFIED value + * @property {number} IN_PROGRESS=1 IN_PROGRESS value + * @property {number} CANCELLING=2 CANCELLING value + * @property {number} CANCELLED=3 CANCELLED value + * @property {number} SUCCEEDED=4 SUCCEEDED value + */ + OSPolicyAssignmentOperationMetadata.RolloutState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLLOUT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_PROGRESS"] = 1; + values[valuesById[2] = "CANCELLING"] = 2; + values[valuesById[3] = "CANCELLED"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + return values; + })(); + + return OSPolicyAssignmentOperationMetadata; + })(); + + v1.CreateOSPolicyAssignmentRequest = (function() { + + /** + * Properties of a CreateOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1 + * @interface ICreateOSPolicyAssignmentRequest + * @property {string|null} [parent] CreateOSPolicyAssignmentRequest parent + * @property {google.cloud.osconfig.v1.IOSPolicyAssignment|null} [osPolicyAssignment] CreateOSPolicyAssignmentRequest osPolicyAssignment + * @property {string|null} [osPolicyAssignmentId] CreateOSPolicyAssignmentRequest osPolicyAssignmentId + */ + + /** + * Constructs a new CreateOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a CreateOSPolicyAssignmentRequest. + * @implements ICreateOSPolicyAssignmentRequest + * @constructor + * @param {google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest=} [properties] Properties to set + */ + function CreateOSPolicyAssignmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateOSPolicyAssignmentRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest + * @instance + */ + CreateOSPolicyAssignmentRequest.prototype.parent = ""; + + /** + * CreateOSPolicyAssignmentRequest osPolicyAssignment. + * @member {google.cloud.osconfig.v1.IOSPolicyAssignment|null|undefined} osPolicyAssignment + * @memberof google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest + * @instance + */ + CreateOSPolicyAssignmentRequest.prototype.osPolicyAssignment = null; + + /** + * CreateOSPolicyAssignmentRequest osPolicyAssignmentId. + * @member {string} osPolicyAssignmentId + * @memberof google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest + * @instance + */ + CreateOSPolicyAssignmentRequest.prototype.osPolicyAssignmentId = ""; + + /** + * Creates a new CreateOSPolicyAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest} CreateOSPolicyAssignmentRequest instance + */ + CreateOSPolicyAssignmentRequest.create = function create(properties) { + return new CreateOSPolicyAssignmentRequest(properties); + }; + + /** + * Encodes the specified CreateOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest} message CreateOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateOSPolicyAssignmentRequest.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.osPolicyAssignment != null && Object.hasOwnProperty.call(message, "osPolicyAssignment")) + $root.google.cloud.osconfig.v1.OSPolicyAssignment.encode(message.osPolicyAssignment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.osPolicyAssignmentId != null && Object.hasOwnProperty.call(message, "osPolicyAssignmentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.osPolicyAssignmentId); + return writer; + }; + + /** + * Encodes the specified CreateOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest} message CreateOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateOSPolicyAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateOSPolicyAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest} CreateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateOSPolicyAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.osPolicyAssignment = $root.google.cloud.osconfig.v1.OSPolicyAssignment.decode(reader, reader.uint32()); + break; + } + case 3: { + message.osPolicyAssignmentId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest} CreateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateOSPolicyAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateOSPolicyAssignmentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateOSPolicyAssignmentRequest.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.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignment.verify(message.osPolicyAssignment); + if (error) + return "osPolicyAssignment." + error; + } + if (message.osPolicyAssignmentId != null && message.hasOwnProperty("osPolicyAssignmentId")) + if (!$util.isString(message.osPolicyAssignmentId)) + return "osPolicyAssignmentId: string expected"; + return null; + }; + + /** + * Creates a CreateOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest} CreateOSPolicyAssignmentRequest + */ + CreateOSPolicyAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.osPolicyAssignment != null) { + if (typeof object.osPolicyAssignment !== "object") + throw TypeError(".google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest.osPolicyAssignment: object expected"); + message.osPolicyAssignment = $root.google.cloud.osconfig.v1.OSPolicyAssignment.fromObject(object.osPolicyAssignment); + } + if (object.osPolicyAssignmentId != null) + message.osPolicyAssignmentId = String(object.osPolicyAssignmentId); + return message; + }; + + /** + * Creates a plain object from a CreateOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest} message CreateOSPolicyAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateOSPolicyAssignmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.osPolicyAssignment = null; + object.osPolicyAssignmentId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + object.osPolicyAssignment = $root.google.cloud.osconfig.v1.OSPolicyAssignment.toObject(message.osPolicyAssignment, options); + if (message.osPolicyAssignmentId != null && message.hasOwnProperty("osPolicyAssignmentId")) + object.osPolicyAssignmentId = message.osPolicyAssignmentId; + return object; + }; + + /** + * Converts this CreateOSPolicyAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateOSPolicyAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateOSPolicyAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateOSPolicyAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest"; + }; + + return CreateOSPolicyAssignmentRequest; + })(); + + v1.UpdateOSPolicyAssignmentRequest = (function() { + + /** + * Properties of an UpdateOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IUpdateOSPolicyAssignmentRequest + * @property {google.cloud.osconfig.v1.IOSPolicyAssignment|null} [osPolicyAssignment] UpdateOSPolicyAssignmentRequest osPolicyAssignment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOSPolicyAssignmentRequest updateMask + */ + + /** + * Constructs a new UpdateOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an UpdateOSPolicyAssignmentRequest. + * @implements IUpdateOSPolicyAssignmentRequest + * @constructor + * @param {google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest=} [properties] Properties to set + */ + function UpdateOSPolicyAssignmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateOSPolicyAssignmentRequest osPolicyAssignment. + * @member {google.cloud.osconfig.v1.IOSPolicyAssignment|null|undefined} osPolicyAssignment + * @memberof google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest + * @instance + */ + UpdateOSPolicyAssignmentRequest.prototype.osPolicyAssignment = null; + + /** + * UpdateOSPolicyAssignmentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest + * @instance + */ + UpdateOSPolicyAssignmentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateOSPolicyAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest} UpdateOSPolicyAssignmentRequest instance + */ + UpdateOSPolicyAssignmentRequest.create = function create(properties) { + return new UpdateOSPolicyAssignmentRequest(properties); + }; + + /** + * Encodes the specified UpdateOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest} message UpdateOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOSPolicyAssignmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyAssignment != null && Object.hasOwnProperty.call(message, "osPolicyAssignment")) + $root.google.cloud.osconfig.v1.OSPolicyAssignment.encode(message.osPolicyAssignment, 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 UpdateOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest} message UpdateOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOSPolicyAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateOSPolicyAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest} UpdateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOSPolicyAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osPolicyAssignment = $root.google.cloud.osconfig.v1.OSPolicyAssignment.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 UpdateOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest} UpdateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOSPolicyAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateOSPolicyAssignmentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateOSPolicyAssignmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignment.verify(message.osPolicyAssignment); + if (error) + return "osPolicyAssignment." + 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 UpdateOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest} UpdateOSPolicyAssignmentRequest + */ + UpdateOSPolicyAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest(); + if (object.osPolicyAssignment != null) { + if (typeof object.osPolicyAssignment !== "object") + throw TypeError(".google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest.osPolicyAssignment: object expected"); + message.osPolicyAssignment = $root.google.cloud.osconfig.v1.OSPolicyAssignment.fromObject(object.osPolicyAssignment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest} message UpdateOSPolicyAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateOSPolicyAssignmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osPolicyAssignment = null; + object.updateMask = null; + } + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + object.osPolicyAssignment = $root.google.cloud.osconfig.v1.OSPolicyAssignment.toObject(message.osPolicyAssignment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateOSPolicyAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOSPolicyAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateOSPolicyAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateOSPolicyAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest"; + }; + + return UpdateOSPolicyAssignmentRequest; + })(); + + v1.GetOSPolicyAssignmentRequest = (function() { + + /** + * Properties of a GetOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IGetOSPolicyAssignmentRequest + * @property {string|null} [name] GetOSPolicyAssignmentRequest name + */ + + /** + * Constructs a new GetOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a GetOSPolicyAssignmentRequest. + * @implements IGetOSPolicyAssignmentRequest + * @constructor + * @param {google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest=} [properties] Properties to set + */ + function GetOSPolicyAssignmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOSPolicyAssignmentRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest + * @instance + */ + GetOSPolicyAssignmentRequest.prototype.name = ""; + + /** + * Creates a new GetOSPolicyAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest} GetOSPolicyAssignmentRequest instance + */ + GetOSPolicyAssignmentRequest.create = function create(properties) { + return new GetOSPolicyAssignmentRequest(properties); + }; + + /** + * Encodes the specified GetOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest} message GetOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOSPolicyAssignmentRequest.encode = function encode(message, writer) { + 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 GetOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest} message GetOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOSPolicyAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOSPolicyAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest} GetOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOSPolicyAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest(); + 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 GetOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest} GetOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOSPolicyAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOSPolicyAssignmentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOSPolicyAssignmentRequest.verify = function verify(message) { + if (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 GetOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest} GetOSPolicyAssignmentRequest + */ + GetOSPolicyAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest} message GetOSPolicyAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOSPolicyAssignmentRequest.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 GetOSPolicyAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + GetOSPolicyAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOSPolicyAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOSPolicyAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest"; + }; + + return GetOSPolicyAssignmentRequest; + })(); + + v1.ListOSPolicyAssignmentsRequest = (function() { + + /** + * Properties of a ListOSPolicyAssignmentsRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IListOSPolicyAssignmentsRequest + * @property {string|null} [parent] ListOSPolicyAssignmentsRequest parent + * @property {number|null} [pageSize] ListOSPolicyAssignmentsRequest pageSize + * @property {string|null} [pageToken] ListOSPolicyAssignmentsRequest pageToken + */ + + /** + * Constructs a new ListOSPolicyAssignmentsRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListOSPolicyAssignmentsRequest. + * @implements IListOSPolicyAssignmentsRequest + * @constructor + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest=} [properties] Properties to set + */ + function ListOSPolicyAssignmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOSPolicyAssignmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest + * @instance + */ + ListOSPolicyAssignmentsRequest.prototype.parent = ""; + + /** + * ListOSPolicyAssignmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest + * @instance + */ + ListOSPolicyAssignmentsRequest.prototype.pageSize = 0; + + /** + * ListOSPolicyAssignmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest + * @instance + */ + ListOSPolicyAssignmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOSPolicyAssignmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest} ListOSPolicyAssignmentsRequest instance + */ + ListOSPolicyAssignmentsRequest.create = function create(properties) { + return new ListOSPolicyAssignmentsRequest(properties); + }; + + /** + * Encodes the specified ListOSPolicyAssignmentsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest} message ListOSPolicyAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentsRequest.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 ListOSPolicyAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest} message ListOSPolicyAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOSPolicyAssignmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest} ListOSPolicyAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest(); + 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 ListOSPolicyAssignmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest} ListOSPolicyAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOSPolicyAssignmentsRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOSPolicyAssignmentsRequest.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 ListOSPolicyAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest} ListOSPolicyAssignmentsRequest + */ + ListOSPolicyAssignmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest(); + 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 ListOSPolicyAssignmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest + * @static + * @param {google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest} message ListOSPolicyAssignmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOSPolicyAssignmentsRequest.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 ListOSPolicyAssignmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOSPolicyAssignmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOSPolicyAssignmentsRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOSPolicyAssignmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest"; + }; + + return ListOSPolicyAssignmentsRequest; + })(); + + v1.ListOSPolicyAssignmentsResponse = (function() { + + /** + * Properties of a ListOSPolicyAssignmentsResponse. + * @memberof google.cloud.osconfig.v1 + * @interface IListOSPolicyAssignmentsResponse + * @property {Array.|null} [osPolicyAssignments] ListOSPolicyAssignmentsResponse osPolicyAssignments + * @property {string|null} [nextPageToken] ListOSPolicyAssignmentsResponse nextPageToken + */ + + /** + * Constructs a new ListOSPolicyAssignmentsResponse. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListOSPolicyAssignmentsResponse. + * @implements IListOSPolicyAssignmentsResponse + * @constructor + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse=} [properties] Properties to set + */ + function ListOSPolicyAssignmentsResponse(properties) { + this.osPolicyAssignments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOSPolicyAssignmentsResponse osPolicyAssignments. + * @member {Array.} osPolicyAssignments + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse + * @instance + */ + ListOSPolicyAssignmentsResponse.prototype.osPolicyAssignments = $util.emptyArray; + + /** + * ListOSPolicyAssignmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse + * @instance + */ + ListOSPolicyAssignmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOSPolicyAssignmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse} ListOSPolicyAssignmentsResponse instance + */ + ListOSPolicyAssignmentsResponse.create = function create(properties) { + return new ListOSPolicyAssignmentsResponse(properties); + }; + + /** + * Encodes the specified ListOSPolicyAssignmentsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse} message ListOSPolicyAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyAssignments != null && message.osPolicyAssignments.length) + for (var i = 0; i < message.osPolicyAssignments.length; ++i) + $root.google.cloud.osconfig.v1.OSPolicyAssignment.encode(message.osPolicyAssignments[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 ListOSPolicyAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse} message ListOSPolicyAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOSPolicyAssignmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse} ListOSPolicyAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.osPolicyAssignments && message.osPolicyAssignments.length)) + message.osPolicyAssignments = []; + message.osPolicyAssignments.push($root.google.cloud.osconfig.v1.OSPolicyAssignment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOSPolicyAssignmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse} ListOSPolicyAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOSPolicyAssignmentsResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOSPolicyAssignmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osPolicyAssignments != null && message.hasOwnProperty("osPolicyAssignments")) { + if (!Array.isArray(message.osPolicyAssignments)) + return "osPolicyAssignments: array expected"; + for (var i = 0; i < message.osPolicyAssignments.length; ++i) { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignment.verify(message.osPolicyAssignments[i]); + if (error) + return "osPolicyAssignments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOSPolicyAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse} ListOSPolicyAssignmentsResponse + */ + ListOSPolicyAssignmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse) + return object; + var message = new $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse(); + if (object.osPolicyAssignments) { + if (!Array.isArray(object.osPolicyAssignments)) + throw TypeError(".google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse.osPolicyAssignments: array expected"); + message.osPolicyAssignments = []; + for (var i = 0; i < object.osPolicyAssignments.length; ++i) { + if (typeof object.osPolicyAssignments[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse.osPolicyAssignments: object expected"); + message.osPolicyAssignments[i] = $root.google.cloud.osconfig.v1.OSPolicyAssignment.fromObject(object.osPolicyAssignments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOSPolicyAssignmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse + * @static + * @param {google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse} message ListOSPolicyAssignmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOSPolicyAssignmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicyAssignments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.osPolicyAssignments && message.osPolicyAssignments.length) { + object.osPolicyAssignments = []; + for (var j = 0; j < message.osPolicyAssignments.length; ++j) + object.osPolicyAssignments[j] = $root.google.cloud.osconfig.v1.OSPolicyAssignment.toObject(message.osPolicyAssignments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOSPolicyAssignmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOSPolicyAssignmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOSPolicyAssignmentsResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOSPolicyAssignmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse"; + }; + + return ListOSPolicyAssignmentsResponse; + })(); + + v1.ListOSPolicyAssignmentRevisionsRequest = (function() { + + /** + * Properties of a ListOSPolicyAssignmentRevisionsRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IListOSPolicyAssignmentRevisionsRequest + * @property {string|null} [name] ListOSPolicyAssignmentRevisionsRequest name + * @property {number|null} [pageSize] ListOSPolicyAssignmentRevisionsRequest pageSize + * @property {string|null} [pageToken] ListOSPolicyAssignmentRevisionsRequest pageToken + */ + + /** + * Constructs a new ListOSPolicyAssignmentRevisionsRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListOSPolicyAssignmentRevisionsRequest. + * @implements IListOSPolicyAssignmentRevisionsRequest + * @constructor + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest=} [properties] Properties to set + */ + function ListOSPolicyAssignmentRevisionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOSPolicyAssignmentRevisionsRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest + * @instance + */ + ListOSPolicyAssignmentRevisionsRequest.prototype.name = ""; + + /** + * ListOSPolicyAssignmentRevisionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest + * @instance + */ + ListOSPolicyAssignmentRevisionsRequest.prototype.pageSize = 0; + + /** + * ListOSPolicyAssignmentRevisionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest + * @instance + */ + ListOSPolicyAssignmentRevisionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOSPolicyAssignmentRevisionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest} ListOSPolicyAssignmentRevisionsRequest instance + */ + ListOSPolicyAssignmentRevisionsRequest.create = function create(properties) { + return new ListOSPolicyAssignmentRevisionsRequest(properties); + }; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest} message ListOSPolicyAssignmentRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentRevisionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest} message ListOSPolicyAssignmentRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest} ListOSPolicyAssignmentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentRevisionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest} ListOSPolicyAssignmentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOSPolicyAssignmentRevisionsRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOSPolicyAssignmentRevisionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOSPolicyAssignmentRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest} ListOSPolicyAssignmentRevisionsRequest + */ + ListOSPolicyAssignmentRevisionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOSPolicyAssignmentRevisionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest} message ListOSPolicyAssignmentRevisionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOSPolicyAssignmentRevisionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListOSPolicyAssignmentRevisionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOSPolicyAssignmentRevisionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOSPolicyAssignmentRevisionsRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOSPolicyAssignmentRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest"; + }; + + return ListOSPolicyAssignmentRevisionsRequest; + })(); + + v1.ListOSPolicyAssignmentRevisionsResponse = (function() { + + /** + * Properties of a ListOSPolicyAssignmentRevisionsResponse. + * @memberof google.cloud.osconfig.v1 + * @interface IListOSPolicyAssignmentRevisionsResponse + * @property {Array.|null} [osPolicyAssignments] ListOSPolicyAssignmentRevisionsResponse osPolicyAssignments + * @property {string|null} [nextPageToken] ListOSPolicyAssignmentRevisionsResponse nextPageToken + */ + + /** + * Constructs a new ListOSPolicyAssignmentRevisionsResponse. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListOSPolicyAssignmentRevisionsResponse. + * @implements IListOSPolicyAssignmentRevisionsResponse + * @constructor + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse=} [properties] Properties to set + */ + function ListOSPolicyAssignmentRevisionsResponse(properties) { + this.osPolicyAssignments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOSPolicyAssignmentRevisionsResponse osPolicyAssignments. + * @member {Array.} osPolicyAssignments + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse + * @instance + */ + ListOSPolicyAssignmentRevisionsResponse.prototype.osPolicyAssignments = $util.emptyArray; + + /** + * ListOSPolicyAssignmentRevisionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse + * @instance + */ + ListOSPolicyAssignmentRevisionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOSPolicyAssignmentRevisionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse} ListOSPolicyAssignmentRevisionsResponse instance + */ + ListOSPolicyAssignmentRevisionsResponse.create = function create(properties) { + return new ListOSPolicyAssignmentRevisionsResponse(properties); + }; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse} message ListOSPolicyAssignmentRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentRevisionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyAssignments != null && message.osPolicyAssignments.length) + for (var i = 0; i < message.osPolicyAssignments.length; ++i) + $root.google.cloud.osconfig.v1.OSPolicyAssignment.encode(message.osPolicyAssignments[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 ListOSPolicyAssignmentRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse} message ListOSPolicyAssignmentRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse} ListOSPolicyAssignmentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentRevisionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.osPolicyAssignments && message.osPolicyAssignments.length)) + message.osPolicyAssignments = []; + message.osPolicyAssignments.push($root.google.cloud.osconfig.v1.OSPolicyAssignment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse} ListOSPolicyAssignmentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOSPolicyAssignmentRevisionsResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOSPolicyAssignmentRevisionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osPolicyAssignments != null && message.hasOwnProperty("osPolicyAssignments")) { + if (!Array.isArray(message.osPolicyAssignments)) + return "osPolicyAssignments: array expected"; + for (var i = 0; i < message.osPolicyAssignments.length; ++i) { + var error = $root.google.cloud.osconfig.v1.OSPolicyAssignment.verify(message.osPolicyAssignments[i]); + if (error) + return "osPolicyAssignments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOSPolicyAssignmentRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse} ListOSPolicyAssignmentRevisionsResponse + */ + ListOSPolicyAssignmentRevisionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse) + return object; + var message = new $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse(); + if (object.osPolicyAssignments) { + if (!Array.isArray(object.osPolicyAssignments)) + throw TypeError(".google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse.osPolicyAssignments: array expected"); + message.osPolicyAssignments = []; + for (var i = 0; i < object.osPolicyAssignments.length; ++i) { + if (typeof object.osPolicyAssignments[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse.osPolicyAssignments: object expected"); + message.osPolicyAssignments[i] = $root.google.cloud.osconfig.v1.OSPolicyAssignment.fromObject(object.osPolicyAssignments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOSPolicyAssignmentRevisionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse} message ListOSPolicyAssignmentRevisionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOSPolicyAssignmentRevisionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicyAssignments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.osPolicyAssignments && message.osPolicyAssignments.length) { + object.osPolicyAssignments = []; + for (var j = 0; j < message.osPolicyAssignments.length; ++j) + object.osPolicyAssignments[j] = $root.google.cloud.osconfig.v1.OSPolicyAssignment.toObject(message.osPolicyAssignments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOSPolicyAssignmentRevisionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOSPolicyAssignmentRevisionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOSPolicyAssignmentRevisionsResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOSPolicyAssignmentRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse"; + }; + + return ListOSPolicyAssignmentRevisionsResponse; + })(); + + v1.DeleteOSPolicyAssignmentRequest = (function() { + + /** + * Properties of a DeleteOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IDeleteOSPolicyAssignmentRequest + * @property {string|null} [name] DeleteOSPolicyAssignmentRequest name + */ + + /** + * Constructs a new DeleteOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a DeleteOSPolicyAssignmentRequest. + * @implements IDeleteOSPolicyAssignmentRequest + * @constructor + * @param {google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest=} [properties] Properties to set + */ + function DeleteOSPolicyAssignmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOSPolicyAssignmentRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest + * @instance + */ + DeleteOSPolicyAssignmentRequest.prototype.name = ""; + + /** + * Creates a new DeleteOSPolicyAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest} DeleteOSPolicyAssignmentRequest instance + */ + DeleteOSPolicyAssignmentRequest.create = function create(properties) { + return new DeleteOSPolicyAssignmentRequest(properties); + }; + + /** + * Encodes the specified DeleteOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest} message DeleteOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOSPolicyAssignmentRequest.encode = function encode(message, writer) { + 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 DeleteOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest} message DeleteOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOSPolicyAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOSPolicyAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest} DeleteOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOSPolicyAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest(); + 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 DeleteOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest} DeleteOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOSPolicyAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOSPolicyAssignmentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOSPolicyAssignmentRequest.verify = function verify(message) { + if (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 DeleteOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest} DeleteOSPolicyAssignmentRequest + */ + DeleteOSPolicyAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest} message DeleteOSPolicyAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOSPolicyAssignmentRequest.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 DeleteOSPolicyAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOSPolicyAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOSPolicyAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOSPolicyAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest"; + }; + + return DeleteOSPolicyAssignmentRequest; + })(); + + v1.FixedOrPercent = (function() { + + /** + * Properties of a FixedOrPercent. + * @memberof google.cloud.osconfig.v1 + * @interface IFixedOrPercent + * @property {number|null} [fixed] FixedOrPercent fixed + * @property {number|null} [percent] FixedOrPercent percent + */ + + /** + * Constructs a new FixedOrPercent. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a FixedOrPercent. + * @implements IFixedOrPercent + * @constructor + * @param {google.cloud.osconfig.v1.IFixedOrPercent=} [properties] Properties to set + */ + function FixedOrPercent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FixedOrPercent fixed. + * @member {number|null|undefined} fixed + * @memberof google.cloud.osconfig.v1.FixedOrPercent + * @instance + */ + FixedOrPercent.prototype.fixed = null; + + /** + * FixedOrPercent percent. + * @member {number|null|undefined} percent + * @memberof google.cloud.osconfig.v1.FixedOrPercent + * @instance + */ + FixedOrPercent.prototype.percent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FixedOrPercent mode. + * @member {"fixed"|"percent"|undefined} mode + * @memberof google.cloud.osconfig.v1.FixedOrPercent + * @instance + */ + Object.defineProperty(FixedOrPercent.prototype, "mode", { + get: $util.oneOfGetter($oneOfFields = ["fixed", "percent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FixedOrPercent instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.FixedOrPercent + * @static + * @param {google.cloud.osconfig.v1.IFixedOrPercent=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.FixedOrPercent} FixedOrPercent instance + */ + FixedOrPercent.create = function create(properties) { + return new FixedOrPercent(properties); + }; + + /** + * Encodes the specified FixedOrPercent message. Does not implicitly {@link google.cloud.osconfig.v1.FixedOrPercent.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.FixedOrPercent + * @static + * @param {google.cloud.osconfig.v1.IFixedOrPercent} message FixedOrPercent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedOrPercent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fixed != null && Object.hasOwnProperty.call(message, "fixed")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fixed); + if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.percent); + return writer; + }; + + /** + * Encodes the specified FixedOrPercent message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.FixedOrPercent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.FixedOrPercent + * @static + * @param {google.cloud.osconfig.v1.IFixedOrPercent} message FixedOrPercent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedOrPercent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FixedOrPercent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.FixedOrPercent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.FixedOrPercent} FixedOrPercent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedOrPercent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.FixedOrPercent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fixed = reader.int32(); + break; + } + case 2: { + message.percent = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FixedOrPercent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.FixedOrPercent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.FixedOrPercent} FixedOrPercent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedOrPercent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FixedOrPercent message. + * @function verify + * @memberof google.cloud.osconfig.v1.FixedOrPercent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FixedOrPercent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fixed != null && message.hasOwnProperty("fixed")) { + properties.mode = 1; + if (!$util.isInteger(message.fixed)) + return "fixed: integer expected"; + } + if (message.percent != null && message.hasOwnProperty("percent")) { + if (properties.mode === 1) + return "mode: multiple values"; + properties.mode = 1; + if (!$util.isInteger(message.percent)) + return "percent: integer expected"; + } + return null; + }; + + /** + * Creates a FixedOrPercent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.FixedOrPercent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.FixedOrPercent} FixedOrPercent + */ + FixedOrPercent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.FixedOrPercent) + return object; + var message = new $root.google.cloud.osconfig.v1.FixedOrPercent(); + if (object.fixed != null) + message.fixed = object.fixed | 0; + if (object.percent != null) + message.percent = object.percent | 0; + return message; + }; + + /** + * Creates a plain object from a FixedOrPercent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.FixedOrPercent + * @static + * @param {google.cloud.osconfig.v1.FixedOrPercent} message FixedOrPercent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FixedOrPercent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.fixed != null && message.hasOwnProperty("fixed")) { + object.fixed = message.fixed; + if (options.oneofs) + object.mode = "fixed"; + } + if (message.percent != null && message.hasOwnProperty("percent")) { + object.percent = message.percent; + if (options.oneofs) + object.mode = "percent"; + } + return object; + }; + + /** + * Converts this FixedOrPercent to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.FixedOrPercent + * @instance + * @returns {Object.} JSON object + */ + FixedOrPercent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FixedOrPercent + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.FixedOrPercent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedOrPercent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.FixedOrPercent"; + }; + + return FixedOrPercent; + })(); + + v1.OsConfigService = (function() { + + /** + * Constructs a new OsConfigService service. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an OsConfigService + * @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 OsConfigService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (OsConfigService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = OsConfigService; + + /** + * Creates new OsConfigService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.osconfig.v1.OsConfigService + * @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 {OsConfigService} RPC service. Useful where requests and/or responses are streamed. + */ + OsConfigService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|executePatchJob}. + * @memberof google.cloud.osconfig.v1.OsConfigService + * @typedef ExecutePatchJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.PatchJob} [response] PatchJob + */ + + /** + * Calls ExecutePatchJob. + * @function executePatchJob + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IExecutePatchJobRequest} request ExecutePatchJobRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigService.ExecutePatchJobCallback} callback Node-style callback called with the error, if any, and PatchJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigService.prototype.executePatchJob = function executePatchJob(request, callback) { + return this.rpcCall(executePatchJob, $root.google.cloud.osconfig.v1.ExecutePatchJobRequest, $root.google.cloud.osconfig.v1.PatchJob, request, callback); + }, "name", { value: "ExecutePatchJob" }); + + /** + * Calls ExecutePatchJob. + * @function executePatchJob + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IExecutePatchJobRequest} request ExecutePatchJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|getPatchJob}. + * @memberof google.cloud.osconfig.v1.OsConfigService + * @typedef GetPatchJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.PatchJob} [response] PatchJob + */ + + /** + * Calls GetPatchJob. + * @function getPatchJob + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IGetPatchJobRequest} request GetPatchJobRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigService.GetPatchJobCallback} callback Node-style callback called with the error, if any, and PatchJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigService.prototype.getPatchJob = function getPatchJob(request, callback) { + return this.rpcCall(getPatchJob, $root.google.cloud.osconfig.v1.GetPatchJobRequest, $root.google.cloud.osconfig.v1.PatchJob, request, callback); + }, "name", { value: "GetPatchJob" }); + + /** + * Calls GetPatchJob. + * @function getPatchJob + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IGetPatchJobRequest} request GetPatchJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|cancelPatchJob}. + * @memberof google.cloud.osconfig.v1.OsConfigService + * @typedef CancelPatchJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.PatchJob} [response] PatchJob + */ + + /** + * Calls CancelPatchJob. + * @function cancelPatchJob + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.ICancelPatchJobRequest} request CancelPatchJobRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigService.CancelPatchJobCallback} callback Node-style callback called with the error, if any, and PatchJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigService.prototype.cancelPatchJob = function cancelPatchJob(request, callback) { + return this.rpcCall(cancelPatchJob, $root.google.cloud.osconfig.v1.CancelPatchJobRequest, $root.google.cloud.osconfig.v1.PatchJob, request, callback); + }, "name", { value: "CancelPatchJob" }); + + /** + * Calls CancelPatchJob. + * @function cancelPatchJob + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.ICancelPatchJobRequest} request CancelPatchJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|listPatchJobs}. + * @memberof google.cloud.osconfig.v1.OsConfigService + * @typedef ListPatchJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.ListPatchJobsResponse} [response] ListPatchJobsResponse + */ + + /** + * Calls ListPatchJobs. + * @function listPatchJobs + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IListPatchJobsRequest} request ListPatchJobsRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigService.ListPatchJobsCallback} callback Node-style callback called with the error, if any, and ListPatchJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigService.prototype.listPatchJobs = function listPatchJobs(request, callback) { + return this.rpcCall(listPatchJobs, $root.google.cloud.osconfig.v1.ListPatchJobsRequest, $root.google.cloud.osconfig.v1.ListPatchJobsResponse, request, callback); + }, "name", { value: "ListPatchJobs" }); + + /** + * Calls ListPatchJobs. + * @function listPatchJobs + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IListPatchJobsRequest} request ListPatchJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|listPatchJobInstanceDetails}. + * @memberof google.cloud.osconfig.v1.OsConfigService + * @typedef ListPatchJobInstanceDetailsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse} [response] ListPatchJobInstanceDetailsResponse + */ + + /** + * Calls ListPatchJobInstanceDetails. + * @function listPatchJobInstanceDetails + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest} request ListPatchJobInstanceDetailsRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigService.ListPatchJobInstanceDetailsCallback} callback Node-style callback called with the error, if any, and ListPatchJobInstanceDetailsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigService.prototype.listPatchJobInstanceDetails = function listPatchJobInstanceDetails(request, callback) { + return this.rpcCall(listPatchJobInstanceDetails, $root.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest, $root.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse, request, callback); + }, "name", { value: "ListPatchJobInstanceDetails" }); + + /** + * Calls ListPatchJobInstanceDetails. + * @function listPatchJobInstanceDetails + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest} request ListPatchJobInstanceDetailsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|createPatchDeployment}. + * @memberof google.cloud.osconfig.v1.OsConfigService + * @typedef CreatePatchDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.PatchDeployment} [response] PatchDeployment + */ + + /** + * Calls CreatePatchDeployment. + * @function createPatchDeployment + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.ICreatePatchDeploymentRequest} request CreatePatchDeploymentRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigService.CreatePatchDeploymentCallback} callback Node-style callback called with the error, if any, and PatchDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigService.prototype.createPatchDeployment = function createPatchDeployment(request, callback) { + return this.rpcCall(createPatchDeployment, $root.google.cloud.osconfig.v1.CreatePatchDeploymentRequest, $root.google.cloud.osconfig.v1.PatchDeployment, request, callback); + }, "name", { value: "CreatePatchDeployment" }); + + /** + * Calls CreatePatchDeployment. + * @function createPatchDeployment + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.ICreatePatchDeploymentRequest} request CreatePatchDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|getPatchDeployment}. + * @memberof google.cloud.osconfig.v1.OsConfigService + * @typedef GetPatchDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.PatchDeployment} [response] PatchDeployment + */ + + /** + * Calls GetPatchDeployment. + * @function getPatchDeployment + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IGetPatchDeploymentRequest} request GetPatchDeploymentRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigService.GetPatchDeploymentCallback} callback Node-style callback called with the error, if any, and PatchDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigService.prototype.getPatchDeployment = function getPatchDeployment(request, callback) { + return this.rpcCall(getPatchDeployment, $root.google.cloud.osconfig.v1.GetPatchDeploymentRequest, $root.google.cloud.osconfig.v1.PatchDeployment, request, callback); + }, "name", { value: "GetPatchDeployment" }); + + /** + * Calls GetPatchDeployment. + * @function getPatchDeployment + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IGetPatchDeploymentRequest} request GetPatchDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|listPatchDeployments}. + * @memberof google.cloud.osconfig.v1.OsConfigService + * @typedef ListPatchDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.ListPatchDeploymentsResponse} [response] ListPatchDeploymentsResponse + */ + + /** + * Calls ListPatchDeployments. + * @function listPatchDeployments + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IListPatchDeploymentsRequest} request ListPatchDeploymentsRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigService.ListPatchDeploymentsCallback} callback Node-style callback called with the error, if any, and ListPatchDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigService.prototype.listPatchDeployments = function listPatchDeployments(request, callback) { + return this.rpcCall(listPatchDeployments, $root.google.cloud.osconfig.v1.ListPatchDeploymentsRequest, $root.google.cloud.osconfig.v1.ListPatchDeploymentsResponse, request, callback); + }, "name", { value: "ListPatchDeployments" }); + + /** + * Calls ListPatchDeployments. + * @function listPatchDeployments + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IListPatchDeploymentsRequest} request ListPatchDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|deletePatchDeployment}. + * @memberof google.cloud.osconfig.v1.OsConfigService + * @typedef DeletePatchDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePatchDeployment. + * @function deletePatchDeployment + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IDeletePatchDeploymentRequest} request DeletePatchDeploymentRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigService.DeletePatchDeploymentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigService.prototype.deletePatchDeployment = function deletePatchDeployment(request, callback) { + return this.rpcCall(deletePatchDeployment, $root.google.cloud.osconfig.v1.DeletePatchDeploymentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePatchDeployment" }); + + /** + * Calls DeletePatchDeployment. + * @function deletePatchDeployment + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IDeletePatchDeploymentRequest} request DeletePatchDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|updatePatchDeployment}. + * @memberof google.cloud.osconfig.v1.OsConfigService + * @typedef UpdatePatchDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.PatchDeployment} [response] PatchDeployment + */ + + /** + * Calls UpdatePatchDeployment. + * @function updatePatchDeployment + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest} request UpdatePatchDeploymentRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigService.UpdatePatchDeploymentCallback} callback Node-style callback called with the error, if any, and PatchDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigService.prototype.updatePatchDeployment = function updatePatchDeployment(request, callback) { + return this.rpcCall(updatePatchDeployment, $root.google.cloud.osconfig.v1.UpdatePatchDeploymentRequest, $root.google.cloud.osconfig.v1.PatchDeployment, request, callback); + }, "name", { value: "UpdatePatchDeployment" }); + + /** + * Calls UpdatePatchDeployment. + * @function updatePatchDeployment + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest} request UpdatePatchDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|pausePatchDeployment}. + * @memberof google.cloud.osconfig.v1.OsConfigService + * @typedef PausePatchDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.PatchDeployment} [response] PatchDeployment + */ + + /** + * Calls PausePatchDeployment. + * @function pausePatchDeployment + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IPausePatchDeploymentRequest} request PausePatchDeploymentRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigService.PausePatchDeploymentCallback} callback Node-style callback called with the error, if any, and PatchDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigService.prototype.pausePatchDeployment = function pausePatchDeployment(request, callback) { + return this.rpcCall(pausePatchDeployment, $root.google.cloud.osconfig.v1.PausePatchDeploymentRequest, $root.google.cloud.osconfig.v1.PatchDeployment, request, callback); + }, "name", { value: "PausePatchDeployment" }); + + /** + * Calls PausePatchDeployment. + * @function pausePatchDeployment + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IPausePatchDeploymentRequest} request PausePatchDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigService|resumePatchDeployment}. + * @memberof google.cloud.osconfig.v1.OsConfigService + * @typedef ResumePatchDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.PatchDeployment} [response] PatchDeployment + */ + + /** + * Calls ResumePatchDeployment. + * @function resumePatchDeployment + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IResumePatchDeploymentRequest} request ResumePatchDeploymentRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigService.ResumePatchDeploymentCallback} callback Node-style callback called with the error, if any, and PatchDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigService.prototype.resumePatchDeployment = function resumePatchDeployment(request, callback) { + return this.rpcCall(resumePatchDeployment, $root.google.cloud.osconfig.v1.ResumePatchDeploymentRequest, $root.google.cloud.osconfig.v1.PatchDeployment, request, callback); + }, "name", { value: "ResumePatchDeployment" }); + + /** + * Calls ResumePatchDeployment. + * @function resumePatchDeployment + * @memberof google.cloud.osconfig.v1.OsConfigService + * @instance + * @param {google.cloud.osconfig.v1.IResumePatchDeploymentRequest} request ResumePatchDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return OsConfigService; + })(); + + v1.PatchDeployment = (function() { + + /** + * Properties of a PatchDeployment. + * @memberof google.cloud.osconfig.v1 + * @interface IPatchDeployment + * @property {string|null} [name] PatchDeployment name + * @property {string|null} [description] PatchDeployment description + * @property {google.cloud.osconfig.v1.IPatchInstanceFilter|null} [instanceFilter] PatchDeployment instanceFilter + * @property {google.cloud.osconfig.v1.IPatchConfig|null} [patchConfig] PatchDeployment patchConfig + * @property {google.protobuf.IDuration|null} [duration] PatchDeployment duration + * @property {google.cloud.osconfig.v1.IOneTimeSchedule|null} [oneTimeSchedule] PatchDeployment oneTimeSchedule + * @property {google.cloud.osconfig.v1.IRecurringSchedule|null} [recurringSchedule] PatchDeployment recurringSchedule + * @property {google.protobuf.ITimestamp|null} [createTime] PatchDeployment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] PatchDeployment updateTime + * @property {google.protobuf.ITimestamp|null} [lastExecuteTime] PatchDeployment lastExecuteTime + * @property {google.cloud.osconfig.v1.IPatchRollout|null} [rollout] PatchDeployment rollout + * @property {google.cloud.osconfig.v1.PatchDeployment.State|null} [state] PatchDeployment state + */ + + /** + * Constructs a new PatchDeployment. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a PatchDeployment. + * @implements IPatchDeployment + * @constructor + * @param {google.cloud.osconfig.v1.IPatchDeployment=} [properties] Properties to set + */ + function PatchDeployment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchDeployment name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + */ + PatchDeployment.prototype.name = ""; + + /** + * PatchDeployment description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + */ + PatchDeployment.prototype.description = ""; + + /** + * PatchDeployment instanceFilter. + * @member {google.cloud.osconfig.v1.IPatchInstanceFilter|null|undefined} instanceFilter + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + */ + PatchDeployment.prototype.instanceFilter = null; + + /** + * PatchDeployment patchConfig. + * @member {google.cloud.osconfig.v1.IPatchConfig|null|undefined} patchConfig + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + */ + PatchDeployment.prototype.patchConfig = null; + + /** + * PatchDeployment duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + */ + PatchDeployment.prototype.duration = null; + + /** + * PatchDeployment oneTimeSchedule. + * @member {google.cloud.osconfig.v1.IOneTimeSchedule|null|undefined} oneTimeSchedule + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + */ + PatchDeployment.prototype.oneTimeSchedule = null; + + /** + * PatchDeployment recurringSchedule. + * @member {google.cloud.osconfig.v1.IRecurringSchedule|null|undefined} recurringSchedule + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + */ + PatchDeployment.prototype.recurringSchedule = null; + + /** + * PatchDeployment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + */ + PatchDeployment.prototype.createTime = null; + + /** + * PatchDeployment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + */ + PatchDeployment.prototype.updateTime = null; + + /** + * PatchDeployment lastExecuteTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastExecuteTime + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + */ + PatchDeployment.prototype.lastExecuteTime = null; + + /** + * PatchDeployment rollout. + * @member {google.cloud.osconfig.v1.IPatchRollout|null|undefined} rollout + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + */ + PatchDeployment.prototype.rollout = null; + + /** + * PatchDeployment state. + * @member {google.cloud.osconfig.v1.PatchDeployment.State} state + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + */ + PatchDeployment.prototype.state = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchDeployment schedule. + * @member {"oneTimeSchedule"|"recurringSchedule"|undefined} schedule + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + */ + Object.defineProperty(PatchDeployment.prototype, "schedule", { + get: $util.oneOfGetter($oneOfFields = ["oneTimeSchedule", "recurringSchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchDeployment instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @static + * @param {google.cloud.osconfig.v1.IPatchDeployment=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.PatchDeployment} PatchDeployment instance + */ + PatchDeployment.create = function create(properties) { + return new PatchDeployment(properties); + }; + + /** + * Encodes the specified PatchDeployment message. Does not implicitly {@link google.cloud.osconfig.v1.PatchDeployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @static + * @param {google.cloud.osconfig.v1.IPatchDeployment} message PatchDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchDeployment.encode = function encode(message, writer) { + if (!writer) + 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.instanceFilter != null && Object.hasOwnProperty.call(message, "instanceFilter")) + $root.google.cloud.osconfig.v1.PatchInstanceFilter.encode(message.instanceFilter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.patchConfig != null && Object.hasOwnProperty.call(message, "patchConfig")) + $root.google.cloud.osconfig.v1.PatchConfig.encode(message.patchConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.oneTimeSchedule != null && Object.hasOwnProperty.call(message, "oneTimeSchedule")) + $root.google.cloud.osconfig.v1.OneTimeSchedule.encode(message.oneTimeSchedule, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.recurringSchedule != null && Object.hasOwnProperty.call(message, "recurringSchedule")) + $root.google.cloud.osconfig.v1.RecurringSchedule.encode(message.recurringSchedule, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.lastExecuteTime != null && Object.hasOwnProperty.call(message, "lastExecuteTime")) + $root.google.protobuf.Timestamp.encode(message.lastExecuteTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + $root.google.cloud.osconfig.v1.PatchRollout.encode(message.rollout, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.state); + return writer; + }; + + /** + * Encodes the specified PatchDeployment message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchDeployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @static + * @param {google.cloud.osconfig.v1.IPatchDeployment} message PatchDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchDeployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchDeployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.PatchDeployment} PatchDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchDeployment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.PatchDeployment(); + 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.instanceFilter = $root.google.cloud.osconfig.v1.PatchInstanceFilter.decode(reader, reader.uint32()); + break; + } + case 4: { + message.patchConfig = $root.google.cloud.osconfig.v1.PatchConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.oneTimeSchedule = $root.google.cloud.osconfig.v1.OneTimeSchedule.decode(reader, reader.uint32()); + break; + } + case 7: { + message.recurringSchedule = $root.google.cloud.osconfig.v1.RecurringSchedule.decode(reader, reader.uint32()); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.lastExecuteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.rollout = $root.google.cloud.osconfig.v1.PatchRollout.decode(reader, reader.uint32()); + break; + } + case 12: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchDeployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.PatchDeployment} PatchDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchDeployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchDeployment message. + * @function verify + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchDeployment.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.instanceFilter != null && message.hasOwnProperty("instanceFilter")) { + var error = $root.google.cloud.osconfig.v1.PatchInstanceFilter.verify(message.instanceFilter); + if (error) + return "instanceFilter." + error; + } + if (message.patchConfig != null && message.hasOwnProperty("patchConfig")) { + var error = $root.google.cloud.osconfig.v1.PatchConfig.verify(message.patchConfig); + if (error) + return "patchConfig." + error; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.oneTimeSchedule != null && message.hasOwnProperty("oneTimeSchedule")) { + properties.schedule = 1; + { + var error = $root.google.cloud.osconfig.v1.OneTimeSchedule.verify(message.oneTimeSchedule); + if (error) + return "oneTimeSchedule." + error; + } + } + if (message.recurringSchedule != null && message.hasOwnProperty("recurringSchedule")) { + if (properties.schedule === 1) + return "schedule: multiple values"; + properties.schedule = 1; + { + var error = $root.google.cloud.osconfig.v1.RecurringSchedule.verify(message.recurringSchedule); + if (error) + return "recurringSchedule." + 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.lastExecuteTime != null && message.hasOwnProperty("lastExecuteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastExecuteTime); + if (error) + return "lastExecuteTime." + error; + } + if (message.rollout != null && message.hasOwnProperty("rollout")) { + var error = $root.google.cloud.osconfig.v1.PatchRollout.verify(message.rollout); + if (error) + return "rollout." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a PatchDeployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.PatchDeployment} PatchDeployment + */ + PatchDeployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.PatchDeployment) + return object; + var message = new $root.google.cloud.osconfig.v1.PatchDeployment(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.instanceFilter != null) { + if (typeof object.instanceFilter !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchDeployment.instanceFilter: object expected"); + message.instanceFilter = $root.google.cloud.osconfig.v1.PatchInstanceFilter.fromObject(object.instanceFilter); + } + if (object.patchConfig != null) { + if (typeof object.patchConfig !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchDeployment.patchConfig: object expected"); + message.patchConfig = $root.google.cloud.osconfig.v1.PatchConfig.fromObject(object.patchConfig); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchDeployment.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.oneTimeSchedule != null) { + if (typeof object.oneTimeSchedule !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchDeployment.oneTimeSchedule: object expected"); + message.oneTimeSchedule = $root.google.cloud.osconfig.v1.OneTimeSchedule.fromObject(object.oneTimeSchedule); + } + if (object.recurringSchedule != null) { + if (typeof object.recurringSchedule !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchDeployment.recurringSchedule: object expected"); + message.recurringSchedule = $root.google.cloud.osconfig.v1.RecurringSchedule.fromObject(object.recurringSchedule); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchDeployment.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.osconfig.v1.PatchDeployment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lastExecuteTime != null) { + if (typeof object.lastExecuteTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchDeployment.lastExecuteTime: object expected"); + message.lastExecuteTime = $root.google.protobuf.Timestamp.fromObject(object.lastExecuteTime); + } + if (object.rollout != null) { + if (typeof object.rollout !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchDeployment.rollout: object expected"); + message.rollout = $root.google.cloud.osconfig.v1.PatchRollout.fromObject(object.rollout); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "PAUSED": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a PatchDeployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @static + * @param {google.cloud.osconfig.v1.PatchDeployment} message PatchDeployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchDeployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.instanceFilter = null; + object.patchConfig = null; + object.duration = null; + object.createTime = null; + object.updateTime = null; + object.lastExecuteTime = null; + object.rollout = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.instanceFilter != null && message.hasOwnProperty("instanceFilter")) + object.instanceFilter = $root.google.cloud.osconfig.v1.PatchInstanceFilter.toObject(message.instanceFilter, options); + if (message.patchConfig != null && message.hasOwnProperty("patchConfig")) + object.patchConfig = $root.google.cloud.osconfig.v1.PatchConfig.toObject(message.patchConfig, options); + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.oneTimeSchedule != null && message.hasOwnProperty("oneTimeSchedule")) { + object.oneTimeSchedule = $root.google.cloud.osconfig.v1.OneTimeSchedule.toObject(message.oneTimeSchedule, options); + if (options.oneofs) + object.schedule = "oneTimeSchedule"; + } + if (message.recurringSchedule != null && message.hasOwnProperty("recurringSchedule")) { + object.recurringSchedule = $root.google.cloud.osconfig.v1.RecurringSchedule.toObject(message.recurringSchedule, options); + if (options.oneofs) + object.schedule = "recurringSchedule"; + } + 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.lastExecuteTime != null && message.hasOwnProperty("lastExecuteTime")) + object.lastExecuteTime = $root.google.protobuf.Timestamp.toObject(message.lastExecuteTime, options); + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = $root.google.cloud.osconfig.v1.PatchRollout.toObject(message.rollout, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.osconfig.v1.PatchDeployment.State[message.state] === undefined ? message.state : $root.google.cloud.osconfig.v1.PatchDeployment.State[message.state] : message.state; + return object; + }; + + /** + * Converts this PatchDeployment to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @instance + * @returns {Object.} JSON object + */ + PatchDeployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PatchDeployment + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.PatchDeployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PatchDeployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.PatchDeployment"; + }; + + /** + * State enum. + * @name google.cloud.osconfig.v1.PatchDeployment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} PAUSED=2 PAUSED value + */ + PatchDeployment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "PAUSED"] = 2; + return values; + })(); + + return PatchDeployment; + })(); + + v1.OneTimeSchedule = (function() { + + /** + * Properties of an OneTimeSchedule. + * @memberof google.cloud.osconfig.v1 + * @interface IOneTimeSchedule + * @property {google.protobuf.ITimestamp|null} [executeTime] OneTimeSchedule executeTime + */ + + /** + * Constructs a new OneTimeSchedule. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an OneTimeSchedule. + * @implements IOneTimeSchedule + * @constructor + * @param {google.cloud.osconfig.v1.IOneTimeSchedule=} [properties] Properties to set + */ + function OneTimeSchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneTimeSchedule executeTime. + * @member {google.protobuf.ITimestamp|null|undefined} executeTime + * @memberof google.cloud.osconfig.v1.OneTimeSchedule + * @instance + */ + OneTimeSchedule.prototype.executeTime = null; + + /** + * Creates a new OneTimeSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.OneTimeSchedule + * @static + * @param {google.cloud.osconfig.v1.IOneTimeSchedule=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.OneTimeSchedule} OneTimeSchedule instance + */ + OneTimeSchedule.create = function create(properties) { + return new OneTimeSchedule(properties); + }; + + /** + * Encodes the specified OneTimeSchedule message. Does not implicitly {@link google.cloud.osconfig.v1.OneTimeSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.OneTimeSchedule + * @static + * @param {google.cloud.osconfig.v1.IOneTimeSchedule} message OneTimeSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneTimeSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.executeTime != null && Object.hasOwnProperty.call(message, "executeTime")) + $root.google.protobuf.Timestamp.encode(message.executeTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneTimeSchedule message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.OneTimeSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.OneTimeSchedule + * @static + * @param {google.cloud.osconfig.v1.IOneTimeSchedule} message OneTimeSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneTimeSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneTimeSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.OneTimeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.OneTimeSchedule} OneTimeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneTimeSchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.OneTimeSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.executeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneTimeSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.OneTimeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.OneTimeSchedule} OneTimeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneTimeSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneTimeSchedule message. + * @function verify + * @memberof google.cloud.osconfig.v1.OneTimeSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneTimeSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.executeTime != null && message.hasOwnProperty("executeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.executeTime); + if (error) + return "executeTime." + error; + } + return null; + }; + + /** + * Creates an OneTimeSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.OneTimeSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.OneTimeSchedule} OneTimeSchedule + */ + OneTimeSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.OneTimeSchedule) + return object; + var message = new $root.google.cloud.osconfig.v1.OneTimeSchedule(); + if (object.executeTime != null) { + if (typeof object.executeTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.OneTimeSchedule.executeTime: object expected"); + message.executeTime = $root.google.protobuf.Timestamp.fromObject(object.executeTime); + } + return message; + }; + + /** + * Creates a plain object from an OneTimeSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.OneTimeSchedule + * @static + * @param {google.cloud.osconfig.v1.OneTimeSchedule} message OneTimeSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneTimeSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.executeTime = null; + if (message.executeTime != null && message.hasOwnProperty("executeTime")) + object.executeTime = $root.google.protobuf.Timestamp.toObject(message.executeTime, options); + return object; + }; + + /** + * Converts this OneTimeSchedule to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.OneTimeSchedule + * @instance + * @returns {Object.} JSON object + */ + OneTimeSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneTimeSchedule + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.OneTimeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneTimeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.OneTimeSchedule"; + }; + + return OneTimeSchedule; + })(); + + v1.RecurringSchedule = (function() { + + /** + * Properties of a RecurringSchedule. + * @memberof google.cloud.osconfig.v1 + * @interface IRecurringSchedule + * @property {google.type.ITimeZone|null} [timeZone] RecurringSchedule timeZone + * @property {google.protobuf.ITimestamp|null} [startTime] RecurringSchedule startTime + * @property {google.protobuf.ITimestamp|null} [endTime] RecurringSchedule endTime + * @property {google.type.ITimeOfDay|null} [timeOfDay] RecurringSchedule timeOfDay + * @property {google.cloud.osconfig.v1.RecurringSchedule.Frequency|null} [frequency] RecurringSchedule frequency + * @property {google.cloud.osconfig.v1.IWeeklySchedule|null} [weekly] RecurringSchedule weekly + * @property {google.cloud.osconfig.v1.IMonthlySchedule|null} [monthly] RecurringSchedule monthly + * @property {google.protobuf.ITimestamp|null} [lastExecuteTime] RecurringSchedule lastExecuteTime + * @property {google.protobuf.ITimestamp|null} [nextExecuteTime] RecurringSchedule nextExecuteTime + */ + + /** + * Constructs a new RecurringSchedule. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a RecurringSchedule. + * @implements IRecurringSchedule + * @constructor + * @param {google.cloud.osconfig.v1.IRecurringSchedule=} [properties] Properties to set + */ + function RecurringSchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecurringSchedule timeZone. + * @member {google.type.ITimeZone|null|undefined} timeZone + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @instance + */ + RecurringSchedule.prototype.timeZone = null; + + /** + * RecurringSchedule startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @instance + */ + RecurringSchedule.prototype.startTime = null; + + /** + * RecurringSchedule endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @instance + */ + RecurringSchedule.prototype.endTime = null; + + /** + * RecurringSchedule timeOfDay. + * @member {google.type.ITimeOfDay|null|undefined} timeOfDay + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @instance + */ + RecurringSchedule.prototype.timeOfDay = null; + + /** + * RecurringSchedule frequency. + * @member {google.cloud.osconfig.v1.RecurringSchedule.Frequency} frequency + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @instance + */ + RecurringSchedule.prototype.frequency = 0; + + /** + * RecurringSchedule weekly. + * @member {google.cloud.osconfig.v1.IWeeklySchedule|null|undefined} weekly + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @instance + */ + RecurringSchedule.prototype.weekly = null; + + /** + * RecurringSchedule monthly. + * @member {google.cloud.osconfig.v1.IMonthlySchedule|null|undefined} monthly + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @instance + */ + RecurringSchedule.prototype.monthly = null; + + /** + * RecurringSchedule lastExecuteTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastExecuteTime + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @instance + */ + RecurringSchedule.prototype.lastExecuteTime = null; + + /** + * RecurringSchedule nextExecuteTime. + * @member {google.protobuf.ITimestamp|null|undefined} nextExecuteTime + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @instance + */ + RecurringSchedule.prototype.nextExecuteTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RecurringSchedule scheduleConfig. + * @member {"weekly"|"monthly"|undefined} scheduleConfig + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @instance + */ + Object.defineProperty(RecurringSchedule.prototype, "scheduleConfig", { + get: $util.oneOfGetter($oneOfFields = ["weekly", "monthly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RecurringSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @static + * @param {google.cloud.osconfig.v1.IRecurringSchedule=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.RecurringSchedule} RecurringSchedule instance + */ + RecurringSchedule.create = function create(properties) { + return new RecurringSchedule(properties); + }; + + /** + * Encodes the specified RecurringSchedule message. Does not implicitly {@link google.cloud.osconfig.v1.RecurringSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @static + * @param {google.cloud.osconfig.v1.IRecurringSchedule} message RecurringSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecurringSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + $root.google.type.TimeZone.encode(message.timeZone, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timeOfDay != null && Object.hasOwnProperty.call(message, "timeOfDay")) + $root.google.type.TimeOfDay.encode(message.timeOfDay, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.frequency != null && Object.hasOwnProperty.call(message, "frequency")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.frequency); + if (message.weekly != null && Object.hasOwnProperty.call(message, "weekly")) + $root.google.cloud.osconfig.v1.WeeklySchedule.encode(message.weekly, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.monthly != null && Object.hasOwnProperty.call(message, "monthly")) + $root.google.cloud.osconfig.v1.MonthlySchedule.encode(message.monthly, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.lastExecuteTime != null && Object.hasOwnProperty.call(message, "lastExecuteTime")) + $root.google.protobuf.Timestamp.encode(message.lastExecuteTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.nextExecuteTime != null && Object.hasOwnProperty.call(message, "nextExecuteTime")) + $root.google.protobuf.Timestamp.encode(message.nextExecuteTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecurringSchedule message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.RecurringSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @static + * @param {google.cloud.osconfig.v1.IRecurringSchedule} message RecurringSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecurringSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecurringSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.RecurringSchedule} RecurringSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecurringSchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.RecurringSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeZone = $root.google.type.TimeZone.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.timeOfDay = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + case 5: { + message.frequency = reader.int32(); + break; + } + case 6: { + message.weekly = $root.google.cloud.osconfig.v1.WeeklySchedule.decode(reader, reader.uint32()); + break; + } + case 7: { + message.monthly = $root.google.cloud.osconfig.v1.MonthlySchedule.decode(reader, reader.uint32()); + break; + } + case 9: { + message.lastExecuteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.nextExecuteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecurringSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.RecurringSchedule} RecurringSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecurringSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecurringSchedule message. + * @function verify + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecurringSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + var error = $root.google.type.TimeZone.verify(message.timeZone); + if (error) + return "timeZone." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.timeOfDay != null && message.hasOwnProperty("timeOfDay")) { + var error = $root.google.type.TimeOfDay.verify(message.timeOfDay); + if (error) + return "timeOfDay." + error; + } + if (message.frequency != null && message.hasOwnProperty("frequency")) + switch (message.frequency) { + default: + return "frequency: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.weekly != null && message.hasOwnProperty("weekly")) { + properties.scheduleConfig = 1; + { + var error = $root.google.cloud.osconfig.v1.WeeklySchedule.verify(message.weekly); + if (error) + return "weekly." + error; + } + } + if (message.monthly != null && message.hasOwnProperty("monthly")) { + if (properties.scheduleConfig === 1) + return "scheduleConfig: multiple values"; + properties.scheduleConfig = 1; + { + var error = $root.google.cloud.osconfig.v1.MonthlySchedule.verify(message.monthly); + if (error) + return "monthly." + error; + } + } + if (message.lastExecuteTime != null && message.hasOwnProperty("lastExecuteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastExecuteTime); + if (error) + return "lastExecuteTime." + error; + } + if (message.nextExecuteTime != null && message.hasOwnProperty("nextExecuteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.nextExecuteTime); + if (error) + return "nextExecuteTime." + error; + } + return null; + }; + + /** + * Creates a RecurringSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.RecurringSchedule} RecurringSchedule + */ + RecurringSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.RecurringSchedule) + return object; + var message = new $root.google.cloud.osconfig.v1.RecurringSchedule(); + if (object.timeZone != null) { + if (typeof object.timeZone !== "object") + throw TypeError(".google.cloud.osconfig.v1.RecurringSchedule.timeZone: object expected"); + message.timeZone = $root.google.type.TimeZone.fromObject(object.timeZone); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.RecurringSchedule.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.RecurringSchedule.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.timeOfDay != null) { + if (typeof object.timeOfDay !== "object") + throw TypeError(".google.cloud.osconfig.v1.RecurringSchedule.timeOfDay: object expected"); + message.timeOfDay = $root.google.type.TimeOfDay.fromObject(object.timeOfDay); + } + switch (object.frequency) { + default: + if (typeof object.frequency === "number") { + message.frequency = object.frequency; + break; + } + break; + case "FREQUENCY_UNSPECIFIED": + case 0: + message.frequency = 0; + break; + case "WEEKLY": + case 1: + message.frequency = 1; + break; + case "MONTHLY": + case 2: + message.frequency = 2; + break; + case "DAILY": + case 3: + message.frequency = 3; + break; + } + if (object.weekly != null) { + if (typeof object.weekly !== "object") + throw TypeError(".google.cloud.osconfig.v1.RecurringSchedule.weekly: object expected"); + message.weekly = $root.google.cloud.osconfig.v1.WeeklySchedule.fromObject(object.weekly); + } + if (object.monthly != null) { + if (typeof object.monthly !== "object") + throw TypeError(".google.cloud.osconfig.v1.RecurringSchedule.monthly: object expected"); + message.monthly = $root.google.cloud.osconfig.v1.MonthlySchedule.fromObject(object.monthly); + } + if (object.lastExecuteTime != null) { + if (typeof object.lastExecuteTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.RecurringSchedule.lastExecuteTime: object expected"); + message.lastExecuteTime = $root.google.protobuf.Timestamp.fromObject(object.lastExecuteTime); + } + if (object.nextExecuteTime != null) { + if (typeof object.nextExecuteTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.RecurringSchedule.nextExecuteTime: object expected"); + message.nextExecuteTime = $root.google.protobuf.Timestamp.fromObject(object.nextExecuteTime); + } + return message; + }; + + /** + * Creates a plain object from a RecurringSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @static + * @param {google.cloud.osconfig.v1.RecurringSchedule} message RecurringSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecurringSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeZone = null; + object.startTime = null; + object.endTime = null; + object.timeOfDay = null; + object.frequency = options.enums === String ? "FREQUENCY_UNSPECIFIED" : 0; + object.lastExecuteTime = null; + object.nextExecuteTime = null; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = $root.google.type.TimeZone.toObject(message.timeZone, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.timeOfDay != null && message.hasOwnProperty("timeOfDay")) + object.timeOfDay = $root.google.type.TimeOfDay.toObject(message.timeOfDay, options); + if (message.frequency != null && message.hasOwnProperty("frequency")) + object.frequency = options.enums === String ? $root.google.cloud.osconfig.v1.RecurringSchedule.Frequency[message.frequency] === undefined ? message.frequency : $root.google.cloud.osconfig.v1.RecurringSchedule.Frequency[message.frequency] : message.frequency; + if (message.weekly != null && message.hasOwnProperty("weekly")) { + object.weekly = $root.google.cloud.osconfig.v1.WeeklySchedule.toObject(message.weekly, options); + if (options.oneofs) + object.scheduleConfig = "weekly"; + } + if (message.monthly != null && message.hasOwnProperty("monthly")) { + object.monthly = $root.google.cloud.osconfig.v1.MonthlySchedule.toObject(message.monthly, options); + if (options.oneofs) + object.scheduleConfig = "monthly"; + } + if (message.lastExecuteTime != null && message.hasOwnProperty("lastExecuteTime")) + object.lastExecuteTime = $root.google.protobuf.Timestamp.toObject(message.lastExecuteTime, options); + if (message.nextExecuteTime != null && message.hasOwnProperty("nextExecuteTime")) + object.nextExecuteTime = $root.google.protobuf.Timestamp.toObject(message.nextExecuteTime, options); + return object; + }; + + /** + * Converts this RecurringSchedule to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @instance + * @returns {Object.} JSON object + */ + RecurringSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecurringSchedule + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.RecurringSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecurringSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.RecurringSchedule"; + }; + + /** + * Frequency enum. + * @name google.cloud.osconfig.v1.RecurringSchedule.Frequency + * @enum {number} + * @property {number} FREQUENCY_UNSPECIFIED=0 FREQUENCY_UNSPECIFIED value + * @property {number} WEEKLY=1 WEEKLY value + * @property {number} MONTHLY=2 MONTHLY value + * @property {number} DAILY=3 DAILY value + */ + RecurringSchedule.Frequency = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FREQUENCY_UNSPECIFIED"] = 0; + values[valuesById[1] = "WEEKLY"] = 1; + values[valuesById[2] = "MONTHLY"] = 2; + values[valuesById[3] = "DAILY"] = 3; + return values; + })(); + + return RecurringSchedule; + })(); + + v1.WeeklySchedule = (function() { + + /** + * Properties of a WeeklySchedule. + * @memberof google.cloud.osconfig.v1 + * @interface IWeeklySchedule + * @property {google.type.DayOfWeek|null} [dayOfWeek] WeeklySchedule dayOfWeek + */ + + /** + * Constructs a new WeeklySchedule. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a WeeklySchedule. + * @implements IWeeklySchedule + * @constructor + * @param {google.cloud.osconfig.v1.IWeeklySchedule=} [properties] Properties to set + */ + function WeeklySchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WeeklySchedule dayOfWeek. + * @member {google.type.DayOfWeek} dayOfWeek + * @memberof google.cloud.osconfig.v1.WeeklySchedule + * @instance + */ + WeeklySchedule.prototype.dayOfWeek = 0; + + /** + * Creates a new WeeklySchedule instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.WeeklySchedule + * @static + * @param {google.cloud.osconfig.v1.IWeeklySchedule=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.WeeklySchedule} WeeklySchedule instance + */ + WeeklySchedule.create = function create(properties) { + return new WeeklySchedule(properties); + }; + + /** + * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.osconfig.v1.WeeklySchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.WeeklySchedule + * @static + * @param {google.cloud.osconfig.v1.IWeeklySchedule} message WeeklySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklySchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dayOfWeek != null && Object.hasOwnProperty.call(message, "dayOfWeek")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dayOfWeek); + return writer; + }; + + /** + * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.WeeklySchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.WeeklySchedule + * @static + * @param {google.cloud.osconfig.v1.IWeeklySchedule} message WeeklySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklySchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.WeeklySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.WeeklySchedule} WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklySchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.WeeklySchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dayOfWeek = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.WeeklySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.WeeklySchedule} WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklySchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeeklySchedule message. + * @function verify + * @memberof google.cloud.osconfig.v1.WeeklySchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeeklySchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + switch (message.dayOfWeek) { + default: + return "dayOfWeek: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + return null; + }; + + /** + * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.WeeklySchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.WeeklySchedule} WeeklySchedule + */ + WeeklySchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.WeeklySchedule) + return object; + var message = new $root.google.cloud.osconfig.v1.WeeklySchedule(); + switch (object.dayOfWeek) { + default: + if (typeof object.dayOfWeek === "number") { + message.dayOfWeek = object.dayOfWeek; + break; + } + break; + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.dayOfWeek = 0; + break; + case "MONDAY": + case 1: + message.dayOfWeek = 1; + break; + case "TUESDAY": + case 2: + message.dayOfWeek = 2; + break; + case "WEDNESDAY": + case 3: + message.dayOfWeek = 3; + break; + case "THURSDAY": + case 4: + message.dayOfWeek = 4; + break; + case "FRIDAY": + case 5: + message.dayOfWeek = 5; + break; + case "SATURDAY": + case 6: + message.dayOfWeek = 6; + break; + case "SUNDAY": + case 7: + message.dayOfWeek = 7; + break; + } + return message; + }; + + /** + * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.WeeklySchedule + * @static + * @param {google.cloud.osconfig.v1.WeeklySchedule} message WeeklySchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeeklySchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dayOfWeek = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + object.dayOfWeek = options.enums === String ? $root.google.type.DayOfWeek[message.dayOfWeek] === undefined ? message.dayOfWeek : $root.google.type.DayOfWeek[message.dayOfWeek] : message.dayOfWeek; + return object; + }; + + /** + * Converts this WeeklySchedule to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.WeeklySchedule + * @instance + * @returns {Object.} JSON object + */ + WeeklySchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WeeklySchedule + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.WeeklySchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeeklySchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.WeeklySchedule"; + }; + + return WeeklySchedule; + })(); + + v1.MonthlySchedule = (function() { + + /** + * Properties of a MonthlySchedule. + * @memberof google.cloud.osconfig.v1 + * @interface IMonthlySchedule + * @property {google.cloud.osconfig.v1.IWeekDayOfMonth|null} [weekDayOfMonth] MonthlySchedule weekDayOfMonth + * @property {number|null} [monthDay] MonthlySchedule monthDay + */ + + /** + * Constructs a new MonthlySchedule. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a MonthlySchedule. + * @implements IMonthlySchedule + * @constructor + * @param {google.cloud.osconfig.v1.IMonthlySchedule=} [properties] Properties to set + */ + function MonthlySchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MonthlySchedule weekDayOfMonth. + * @member {google.cloud.osconfig.v1.IWeekDayOfMonth|null|undefined} weekDayOfMonth + * @memberof google.cloud.osconfig.v1.MonthlySchedule + * @instance + */ + MonthlySchedule.prototype.weekDayOfMonth = null; + + /** + * MonthlySchedule monthDay. + * @member {number|null|undefined} monthDay + * @memberof google.cloud.osconfig.v1.MonthlySchedule + * @instance + */ + MonthlySchedule.prototype.monthDay = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MonthlySchedule dayOfMonth. + * @member {"weekDayOfMonth"|"monthDay"|undefined} dayOfMonth + * @memberof google.cloud.osconfig.v1.MonthlySchedule + * @instance + */ + Object.defineProperty(MonthlySchedule.prototype, "dayOfMonth", { + get: $util.oneOfGetter($oneOfFields = ["weekDayOfMonth", "monthDay"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MonthlySchedule instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.MonthlySchedule + * @static + * @param {google.cloud.osconfig.v1.IMonthlySchedule=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.MonthlySchedule} MonthlySchedule instance + */ + MonthlySchedule.create = function create(properties) { + return new MonthlySchedule(properties); + }; + + /** + * Encodes the specified MonthlySchedule message. Does not implicitly {@link google.cloud.osconfig.v1.MonthlySchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.MonthlySchedule + * @static + * @param {google.cloud.osconfig.v1.IMonthlySchedule} message MonthlySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonthlySchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.weekDayOfMonth != null && Object.hasOwnProperty.call(message, "weekDayOfMonth")) + $root.google.cloud.osconfig.v1.WeekDayOfMonth.encode(message.weekDayOfMonth, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.monthDay != null && Object.hasOwnProperty.call(message, "monthDay")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.monthDay); + return writer; + }; + + /** + * Encodes the specified MonthlySchedule message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.MonthlySchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.MonthlySchedule + * @static + * @param {google.cloud.osconfig.v1.IMonthlySchedule} message MonthlySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonthlySchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MonthlySchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.MonthlySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.MonthlySchedule} MonthlySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonthlySchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.MonthlySchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.weekDayOfMonth = $root.google.cloud.osconfig.v1.WeekDayOfMonth.decode(reader, reader.uint32()); + break; + } + case 2: { + message.monthDay = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MonthlySchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.MonthlySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.MonthlySchedule} MonthlySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonthlySchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MonthlySchedule message. + * @function verify + * @memberof google.cloud.osconfig.v1.MonthlySchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MonthlySchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.weekDayOfMonth != null && message.hasOwnProperty("weekDayOfMonth")) { + properties.dayOfMonth = 1; + { + var error = $root.google.cloud.osconfig.v1.WeekDayOfMonth.verify(message.weekDayOfMonth); + if (error) + return "weekDayOfMonth." + error; + } + } + if (message.monthDay != null && message.hasOwnProperty("monthDay")) { + if (properties.dayOfMonth === 1) + return "dayOfMonth: multiple values"; + properties.dayOfMonth = 1; + if (!$util.isInteger(message.monthDay)) + return "monthDay: integer expected"; + } + return null; + }; + + /** + * Creates a MonthlySchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.MonthlySchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.MonthlySchedule} MonthlySchedule + */ + MonthlySchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.MonthlySchedule) + return object; + var message = new $root.google.cloud.osconfig.v1.MonthlySchedule(); + if (object.weekDayOfMonth != null) { + if (typeof object.weekDayOfMonth !== "object") + throw TypeError(".google.cloud.osconfig.v1.MonthlySchedule.weekDayOfMonth: object expected"); + message.weekDayOfMonth = $root.google.cloud.osconfig.v1.WeekDayOfMonth.fromObject(object.weekDayOfMonth); + } + if (object.monthDay != null) + message.monthDay = object.monthDay | 0; + return message; + }; + + /** + * Creates a plain object from a MonthlySchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.MonthlySchedule + * @static + * @param {google.cloud.osconfig.v1.MonthlySchedule} message MonthlySchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MonthlySchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.weekDayOfMonth != null && message.hasOwnProperty("weekDayOfMonth")) { + object.weekDayOfMonth = $root.google.cloud.osconfig.v1.WeekDayOfMonth.toObject(message.weekDayOfMonth, options); + if (options.oneofs) + object.dayOfMonth = "weekDayOfMonth"; + } + if (message.monthDay != null && message.hasOwnProperty("monthDay")) { + object.monthDay = message.monthDay; + if (options.oneofs) + object.dayOfMonth = "monthDay"; + } + return object; + }; + + /** + * Converts this MonthlySchedule to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.MonthlySchedule + * @instance + * @returns {Object.} JSON object + */ + MonthlySchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MonthlySchedule + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.MonthlySchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MonthlySchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.MonthlySchedule"; + }; + + return MonthlySchedule; + })(); + + v1.WeekDayOfMonth = (function() { + + /** + * Properties of a WeekDayOfMonth. + * @memberof google.cloud.osconfig.v1 + * @interface IWeekDayOfMonth + * @property {number|null} [weekOrdinal] WeekDayOfMonth weekOrdinal + * @property {google.type.DayOfWeek|null} [dayOfWeek] WeekDayOfMonth dayOfWeek + * @property {number|null} [dayOffset] WeekDayOfMonth dayOffset + */ + + /** + * Constructs a new WeekDayOfMonth. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a WeekDayOfMonth. + * @implements IWeekDayOfMonth + * @constructor + * @param {google.cloud.osconfig.v1.IWeekDayOfMonth=} [properties] Properties to set + */ + function WeekDayOfMonth(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WeekDayOfMonth weekOrdinal. + * @member {number} weekOrdinal + * @memberof google.cloud.osconfig.v1.WeekDayOfMonth + * @instance + */ + WeekDayOfMonth.prototype.weekOrdinal = 0; + + /** + * WeekDayOfMonth dayOfWeek. + * @member {google.type.DayOfWeek} dayOfWeek + * @memberof google.cloud.osconfig.v1.WeekDayOfMonth + * @instance + */ + WeekDayOfMonth.prototype.dayOfWeek = 0; + + /** + * WeekDayOfMonth dayOffset. + * @member {number} dayOffset + * @memberof google.cloud.osconfig.v1.WeekDayOfMonth + * @instance + */ + WeekDayOfMonth.prototype.dayOffset = 0; + + /** + * Creates a new WeekDayOfMonth instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.WeekDayOfMonth + * @static + * @param {google.cloud.osconfig.v1.IWeekDayOfMonth=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.WeekDayOfMonth} WeekDayOfMonth instance + */ + WeekDayOfMonth.create = function create(properties) { + return new WeekDayOfMonth(properties); + }; + + /** + * Encodes the specified WeekDayOfMonth message. Does not implicitly {@link google.cloud.osconfig.v1.WeekDayOfMonth.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.WeekDayOfMonth + * @static + * @param {google.cloud.osconfig.v1.IWeekDayOfMonth} message WeekDayOfMonth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeekDayOfMonth.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.weekOrdinal != null && Object.hasOwnProperty.call(message, "weekOrdinal")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.weekOrdinal); + if (message.dayOfWeek != null && Object.hasOwnProperty.call(message, "dayOfWeek")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dayOfWeek); + if (message.dayOffset != null && Object.hasOwnProperty.call(message, "dayOffset")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dayOffset); + return writer; + }; + + /** + * Encodes the specified WeekDayOfMonth message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.WeekDayOfMonth.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.WeekDayOfMonth + * @static + * @param {google.cloud.osconfig.v1.IWeekDayOfMonth} message WeekDayOfMonth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeekDayOfMonth.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.WeekDayOfMonth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.WeekDayOfMonth} WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeekDayOfMonth.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.WeekDayOfMonth(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.weekOrdinal = reader.int32(); + break; + } + case 2: { + message.dayOfWeek = reader.int32(); + break; + } + case 3: { + message.dayOffset = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.WeekDayOfMonth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.WeekDayOfMonth} WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeekDayOfMonth.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeekDayOfMonth message. + * @function verify + * @memberof google.cloud.osconfig.v1.WeekDayOfMonth + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeekDayOfMonth.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.weekOrdinal != null && message.hasOwnProperty("weekOrdinal")) + if (!$util.isInteger(message.weekOrdinal)) + return "weekOrdinal: integer expected"; + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + switch (message.dayOfWeek) { + default: + return "dayOfWeek: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.dayOffset != null && message.hasOwnProperty("dayOffset")) + if (!$util.isInteger(message.dayOffset)) + return "dayOffset: integer expected"; + return null; + }; + + /** + * Creates a WeekDayOfMonth message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.WeekDayOfMonth + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.WeekDayOfMonth} WeekDayOfMonth + */ + WeekDayOfMonth.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.WeekDayOfMonth) + return object; + var message = new $root.google.cloud.osconfig.v1.WeekDayOfMonth(); + if (object.weekOrdinal != null) + message.weekOrdinal = object.weekOrdinal | 0; + switch (object.dayOfWeek) { + default: + if (typeof object.dayOfWeek === "number") { + message.dayOfWeek = object.dayOfWeek; + break; + } + break; + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.dayOfWeek = 0; + break; + case "MONDAY": + case 1: + message.dayOfWeek = 1; + break; + case "TUESDAY": + case 2: + message.dayOfWeek = 2; + break; + case "WEDNESDAY": + case 3: + message.dayOfWeek = 3; + break; + case "THURSDAY": + case 4: + message.dayOfWeek = 4; + break; + case "FRIDAY": + case 5: + message.dayOfWeek = 5; + break; + case "SATURDAY": + case 6: + message.dayOfWeek = 6; + break; + case "SUNDAY": + case 7: + message.dayOfWeek = 7; + break; + } + if (object.dayOffset != null) + message.dayOffset = object.dayOffset | 0; + return message; + }; + + /** + * Creates a plain object from a WeekDayOfMonth message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.WeekDayOfMonth + * @static + * @param {google.cloud.osconfig.v1.WeekDayOfMonth} message WeekDayOfMonth + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeekDayOfMonth.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.weekOrdinal = 0; + object.dayOfWeek = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; + object.dayOffset = 0; + } + if (message.weekOrdinal != null && message.hasOwnProperty("weekOrdinal")) + object.weekOrdinal = message.weekOrdinal; + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + object.dayOfWeek = options.enums === String ? $root.google.type.DayOfWeek[message.dayOfWeek] === undefined ? message.dayOfWeek : $root.google.type.DayOfWeek[message.dayOfWeek] : message.dayOfWeek; + if (message.dayOffset != null && message.hasOwnProperty("dayOffset")) + object.dayOffset = message.dayOffset; + return object; + }; + + /** + * Converts this WeekDayOfMonth to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.WeekDayOfMonth + * @instance + * @returns {Object.} JSON object + */ + WeekDayOfMonth.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WeekDayOfMonth + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.WeekDayOfMonth + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeekDayOfMonth.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.WeekDayOfMonth"; + }; + + return WeekDayOfMonth; + })(); + + v1.CreatePatchDeploymentRequest = (function() { + + /** + * Properties of a CreatePatchDeploymentRequest. + * @memberof google.cloud.osconfig.v1 + * @interface ICreatePatchDeploymentRequest + * @property {string|null} [parent] CreatePatchDeploymentRequest parent + * @property {string|null} [patchDeploymentId] CreatePatchDeploymentRequest patchDeploymentId + * @property {google.cloud.osconfig.v1.IPatchDeployment|null} [patchDeployment] CreatePatchDeploymentRequest patchDeployment + */ + + /** + * Constructs a new CreatePatchDeploymentRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a CreatePatchDeploymentRequest. + * @implements ICreatePatchDeploymentRequest + * @constructor + * @param {google.cloud.osconfig.v1.ICreatePatchDeploymentRequest=} [properties] Properties to set + */ + function CreatePatchDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePatchDeploymentRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1.CreatePatchDeploymentRequest + * @instance + */ + CreatePatchDeploymentRequest.prototype.parent = ""; + + /** + * CreatePatchDeploymentRequest patchDeploymentId. + * @member {string} patchDeploymentId + * @memberof google.cloud.osconfig.v1.CreatePatchDeploymentRequest + * @instance + */ + CreatePatchDeploymentRequest.prototype.patchDeploymentId = ""; + + /** + * CreatePatchDeploymentRequest patchDeployment. + * @member {google.cloud.osconfig.v1.IPatchDeployment|null|undefined} patchDeployment + * @memberof google.cloud.osconfig.v1.CreatePatchDeploymentRequest + * @instance + */ + CreatePatchDeploymentRequest.prototype.patchDeployment = null; + + /** + * Creates a new CreatePatchDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.CreatePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.ICreatePatchDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.CreatePatchDeploymentRequest} CreatePatchDeploymentRequest instance + */ + CreatePatchDeploymentRequest.create = function create(properties) { + return new CreatePatchDeploymentRequest(properties); + }; + + /** + * Encodes the specified CreatePatchDeploymentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.CreatePatchDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.CreatePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.ICreatePatchDeploymentRequest} message CreatePatchDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePatchDeploymentRequest.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.patchDeploymentId != null && Object.hasOwnProperty.call(message, "patchDeploymentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.patchDeploymentId); + if (message.patchDeployment != null && Object.hasOwnProperty.call(message, "patchDeployment")) + $root.google.cloud.osconfig.v1.PatchDeployment.encode(message.patchDeployment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatePatchDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.CreatePatchDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.CreatePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.ICreatePatchDeploymentRequest} message CreatePatchDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePatchDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePatchDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.CreatePatchDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.CreatePatchDeploymentRequest} CreatePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePatchDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.CreatePatchDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.patchDeploymentId = reader.string(); + break; + } + case 3: { + message.patchDeployment = $root.google.cloud.osconfig.v1.PatchDeployment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePatchDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.CreatePatchDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.CreatePatchDeploymentRequest} CreatePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePatchDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePatchDeploymentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.CreatePatchDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePatchDeploymentRequest.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.patchDeploymentId != null && message.hasOwnProperty("patchDeploymentId")) + if (!$util.isString(message.patchDeploymentId)) + return "patchDeploymentId: string expected"; + if (message.patchDeployment != null && message.hasOwnProperty("patchDeployment")) { + var error = $root.google.cloud.osconfig.v1.PatchDeployment.verify(message.patchDeployment); + if (error) + return "patchDeployment." + error; + } + return null; + }; + + /** + * Creates a CreatePatchDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.CreatePatchDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.CreatePatchDeploymentRequest} CreatePatchDeploymentRequest + */ + CreatePatchDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.CreatePatchDeploymentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.CreatePatchDeploymentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.patchDeploymentId != null) + message.patchDeploymentId = String(object.patchDeploymentId); + if (object.patchDeployment != null) { + if (typeof object.patchDeployment !== "object") + throw TypeError(".google.cloud.osconfig.v1.CreatePatchDeploymentRequest.patchDeployment: object expected"); + message.patchDeployment = $root.google.cloud.osconfig.v1.PatchDeployment.fromObject(object.patchDeployment); + } + return message; + }; + + /** + * Creates a plain object from a CreatePatchDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.CreatePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.CreatePatchDeploymentRequest} message CreatePatchDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePatchDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.patchDeploymentId = ""; + object.patchDeployment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.patchDeploymentId != null && message.hasOwnProperty("patchDeploymentId")) + object.patchDeploymentId = message.patchDeploymentId; + if (message.patchDeployment != null && message.hasOwnProperty("patchDeployment")) + object.patchDeployment = $root.google.cloud.osconfig.v1.PatchDeployment.toObject(message.patchDeployment, options); + return object; + }; + + /** + * Converts this CreatePatchDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.CreatePatchDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePatchDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePatchDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.CreatePatchDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePatchDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.CreatePatchDeploymentRequest"; + }; + + return CreatePatchDeploymentRequest; + })(); + + v1.GetPatchDeploymentRequest = (function() { + + /** + * Properties of a GetPatchDeploymentRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IGetPatchDeploymentRequest + * @property {string|null} [name] GetPatchDeploymentRequest name + */ + + /** + * Constructs a new GetPatchDeploymentRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a GetPatchDeploymentRequest. + * @implements IGetPatchDeploymentRequest + * @constructor + * @param {google.cloud.osconfig.v1.IGetPatchDeploymentRequest=} [properties] Properties to set + */ + function GetPatchDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPatchDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.GetPatchDeploymentRequest + * @instance + */ + GetPatchDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetPatchDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.GetPatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IGetPatchDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.GetPatchDeploymentRequest} GetPatchDeploymentRequest instance + */ + GetPatchDeploymentRequest.create = function create(properties) { + return new GetPatchDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetPatchDeploymentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetPatchDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.GetPatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IGetPatchDeploymentRequest} message GetPatchDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPatchDeploymentRequest.encode = function encode(message, writer) { + 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 GetPatchDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetPatchDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.GetPatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IGetPatchDeploymentRequest} message GetPatchDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPatchDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPatchDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.GetPatchDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.GetPatchDeploymentRequest} GetPatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPatchDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.GetPatchDeploymentRequest(); + 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 GetPatchDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.GetPatchDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.GetPatchDeploymentRequest} GetPatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPatchDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPatchDeploymentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.GetPatchDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPatchDeploymentRequest.verify = function verify(message) { + if (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 GetPatchDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.GetPatchDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.GetPatchDeploymentRequest} GetPatchDeploymentRequest + */ + GetPatchDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.GetPatchDeploymentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.GetPatchDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPatchDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.GetPatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.GetPatchDeploymentRequest} message GetPatchDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPatchDeploymentRequest.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 GetPatchDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.GetPatchDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetPatchDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPatchDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.GetPatchDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPatchDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.GetPatchDeploymentRequest"; + }; + + return GetPatchDeploymentRequest; + })(); + + v1.ListPatchDeploymentsRequest = (function() { + + /** + * Properties of a ListPatchDeploymentsRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IListPatchDeploymentsRequest + * @property {string|null} [parent] ListPatchDeploymentsRequest parent + * @property {number|null} [pageSize] ListPatchDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListPatchDeploymentsRequest pageToken + */ + + /** + * Constructs a new ListPatchDeploymentsRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListPatchDeploymentsRequest. + * @implements IListPatchDeploymentsRequest + * @constructor + * @param {google.cloud.osconfig.v1.IListPatchDeploymentsRequest=} [properties] Properties to set + */ + function ListPatchDeploymentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPatchDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsRequest + * @instance + */ + ListPatchDeploymentsRequest.prototype.parent = ""; + + /** + * ListPatchDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsRequest + * @instance + */ + ListPatchDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListPatchDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsRequest + * @instance + */ + ListPatchDeploymentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPatchDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsRequest + * @static + * @param {google.cloud.osconfig.v1.IListPatchDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListPatchDeploymentsRequest} ListPatchDeploymentsRequest instance + */ + ListPatchDeploymentsRequest.create = function create(properties) { + return new ListPatchDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListPatchDeploymentsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsRequest + * @static + * @param {google.cloud.osconfig.v1.IListPatchDeploymentsRequest} message ListPatchDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPatchDeploymentsRequest.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 ListPatchDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsRequest + * @static + * @param {google.cloud.osconfig.v1.IListPatchDeploymentsRequest} message ListPatchDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPatchDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPatchDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListPatchDeploymentsRequest} ListPatchDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPatchDeploymentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListPatchDeploymentsRequest(); + 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 ListPatchDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListPatchDeploymentsRequest} ListPatchDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPatchDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPatchDeploymentsRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPatchDeploymentsRequest.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 ListPatchDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListPatchDeploymentsRequest} ListPatchDeploymentsRequest + */ + ListPatchDeploymentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListPatchDeploymentsRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.ListPatchDeploymentsRequest(); + 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 ListPatchDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsRequest + * @static + * @param {google.cloud.osconfig.v1.ListPatchDeploymentsRequest} message ListPatchDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPatchDeploymentsRequest.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 ListPatchDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPatchDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPatchDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPatchDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListPatchDeploymentsRequest"; + }; + + return ListPatchDeploymentsRequest; + })(); + + v1.ListPatchDeploymentsResponse = (function() { + + /** + * Properties of a ListPatchDeploymentsResponse. + * @memberof google.cloud.osconfig.v1 + * @interface IListPatchDeploymentsResponse + * @property {Array.|null} [patchDeployments] ListPatchDeploymentsResponse patchDeployments + * @property {string|null} [nextPageToken] ListPatchDeploymentsResponse nextPageToken + */ + + /** + * Constructs a new ListPatchDeploymentsResponse. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListPatchDeploymentsResponse. + * @implements IListPatchDeploymentsResponse + * @constructor + * @param {google.cloud.osconfig.v1.IListPatchDeploymentsResponse=} [properties] Properties to set + */ + function ListPatchDeploymentsResponse(properties) { + this.patchDeployments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPatchDeploymentsResponse patchDeployments. + * @member {Array.} patchDeployments + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsResponse + * @instance + */ + ListPatchDeploymentsResponse.prototype.patchDeployments = $util.emptyArray; + + /** + * ListPatchDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsResponse + * @instance + */ + ListPatchDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPatchDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsResponse + * @static + * @param {google.cloud.osconfig.v1.IListPatchDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListPatchDeploymentsResponse} ListPatchDeploymentsResponse instance + */ + ListPatchDeploymentsResponse.create = function create(properties) { + return new ListPatchDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListPatchDeploymentsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsResponse + * @static + * @param {google.cloud.osconfig.v1.IListPatchDeploymentsResponse} message ListPatchDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPatchDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.patchDeployments != null && message.patchDeployments.length) + for (var i = 0; i < message.patchDeployments.length; ++i) + $root.google.cloud.osconfig.v1.PatchDeployment.encode(message.patchDeployments[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 ListPatchDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsResponse + * @static + * @param {google.cloud.osconfig.v1.IListPatchDeploymentsResponse} message ListPatchDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPatchDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPatchDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListPatchDeploymentsResponse} ListPatchDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPatchDeploymentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListPatchDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.patchDeployments && message.patchDeployments.length)) + message.patchDeployments = []; + message.patchDeployments.push($root.google.cloud.osconfig.v1.PatchDeployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPatchDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListPatchDeploymentsResponse} ListPatchDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPatchDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPatchDeploymentsResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPatchDeploymentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.patchDeployments != null && message.hasOwnProperty("patchDeployments")) { + if (!Array.isArray(message.patchDeployments)) + return "patchDeployments: array expected"; + for (var i = 0; i < message.patchDeployments.length; ++i) { + var error = $root.google.cloud.osconfig.v1.PatchDeployment.verify(message.patchDeployments[i]); + if (error) + return "patchDeployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPatchDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListPatchDeploymentsResponse} ListPatchDeploymentsResponse + */ + ListPatchDeploymentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListPatchDeploymentsResponse) + return object; + var message = new $root.google.cloud.osconfig.v1.ListPatchDeploymentsResponse(); + if (object.patchDeployments) { + if (!Array.isArray(object.patchDeployments)) + throw TypeError(".google.cloud.osconfig.v1.ListPatchDeploymentsResponse.patchDeployments: array expected"); + message.patchDeployments = []; + for (var i = 0; i < object.patchDeployments.length; ++i) { + if (typeof object.patchDeployments[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.ListPatchDeploymentsResponse.patchDeployments: object expected"); + message.patchDeployments[i] = $root.google.cloud.osconfig.v1.PatchDeployment.fromObject(object.patchDeployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPatchDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsResponse + * @static + * @param {google.cloud.osconfig.v1.ListPatchDeploymentsResponse} message ListPatchDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPatchDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.patchDeployments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.patchDeployments && message.patchDeployments.length) { + object.patchDeployments = []; + for (var j = 0; j < message.patchDeployments.length; ++j) + object.patchDeployments[j] = $root.google.cloud.osconfig.v1.PatchDeployment.toObject(message.patchDeployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPatchDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPatchDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPatchDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListPatchDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPatchDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListPatchDeploymentsResponse"; + }; + + return ListPatchDeploymentsResponse; + })(); + + v1.DeletePatchDeploymentRequest = (function() { + + /** + * Properties of a DeletePatchDeploymentRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IDeletePatchDeploymentRequest + * @property {string|null} [name] DeletePatchDeploymentRequest name + */ + + /** + * Constructs a new DeletePatchDeploymentRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a DeletePatchDeploymentRequest. + * @implements IDeletePatchDeploymentRequest + * @constructor + * @param {google.cloud.osconfig.v1.IDeletePatchDeploymentRequest=} [properties] Properties to set + */ + function DeletePatchDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePatchDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.DeletePatchDeploymentRequest + * @instance + */ + DeletePatchDeploymentRequest.prototype.name = ""; + + /** + * Creates a new DeletePatchDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.DeletePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IDeletePatchDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.DeletePatchDeploymentRequest} DeletePatchDeploymentRequest instance + */ + DeletePatchDeploymentRequest.create = function create(properties) { + return new DeletePatchDeploymentRequest(properties); + }; + + /** + * Encodes the specified DeletePatchDeploymentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.DeletePatchDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.DeletePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IDeletePatchDeploymentRequest} message DeletePatchDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePatchDeploymentRequest.encode = function encode(message, writer) { + 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 DeletePatchDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.DeletePatchDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.DeletePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IDeletePatchDeploymentRequest} message DeletePatchDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePatchDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePatchDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.DeletePatchDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.DeletePatchDeploymentRequest} DeletePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePatchDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.DeletePatchDeploymentRequest(); + 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 DeletePatchDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.DeletePatchDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.DeletePatchDeploymentRequest} DeletePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePatchDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePatchDeploymentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.DeletePatchDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePatchDeploymentRequest.verify = function verify(message) { + if (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 DeletePatchDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.DeletePatchDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.DeletePatchDeploymentRequest} DeletePatchDeploymentRequest + */ + DeletePatchDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.DeletePatchDeploymentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.DeletePatchDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePatchDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.DeletePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.DeletePatchDeploymentRequest} message DeletePatchDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePatchDeploymentRequest.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 DeletePatchDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.DeletePatchDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePatchDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePatchDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.DeletePatchDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePatchDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.DeletePatchDeploymentRequest"; + }; + + return DeletePatchDeploymentRequest; + })(); + + v1.UpdatePatchDeploymentRequest = (function() { + + /** + * Properties of an UpdatePatchDeploymentRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IUpdatePatchDeploymentRequest + * @property {google.cloud.osconfig.v1.IPatchDeployment|null} [patchDeployment] UpdatePatchDeploymentRequest patchDeployment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePatchDeploymentRequest updateMask + */ + + /** + * Constructs a new UpdatePatchDeploymentRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an UpdatePatchDeploymentRequest. + * @implements IUpdatePatchDeploymentRequest + * @constructor + * @param {google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest=} [properties] Properties to set + */ + function UpdatePatchDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePatchDeploymentRequest patchDeployment. + * @member {google.cloud.osconfig.v1.IPatchDeployment|null|undefined} patchDeployment + * @memberof google.cloud.osconfig.v1.UpdatePatchDeploymentRequest + * @instance + */ + UpdatePatchDeploymentRequest.prototype.patchDeployment = null; + + /** + * UpdatePatchDeploymentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.osconfig.v1.UpdatePatchDeploymentRequest + * @instance + */ + UpdatePatchDeploymentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdatePatchDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.UpdatePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.UpdatePatchDeploymentRequest} UpdatePatchDeploymentRequest instance + */ + UpdatePatchDeploymentRequest.create = function create(properties) { + return new UpdatePatchDeploymentRequest(properties); + }; + + /** + * Encodes the specified UpdatePatchDeploymentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.UpdatePatchDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.UpdatePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest} message UpdatePatchDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePatchDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.patchDeployment != null && Object.hasOwnProperty.call(message, "patchDeployment")) + $root.google.cloud.osconfig.v1.PatchDeployment.encode(message.patchDeployment, 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 UpdatePatchDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.UpdatePatchDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.UpdatePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest} message UpdatePatchDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePatchDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePatchDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.UpdatePatchDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.UpdatePatchDeploymentRequest} UpdatePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePatchDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.UpdatePatchDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.patchDeployment = $root.google.cloud.osconfig.v1.PatchDeployment.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 UpdatePatchDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.UpdatePatchDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.UpdatePatchDeploymentRequest} UpdatePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePatchDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePatchDeploymentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.UpdatePatchDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePatchDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.patchDeployment != null && message.hasOwnProperty("patchDeployment")) { + var error = $root.google.cloud.osconfig.v1.PatchDeployment.verify(message.patchDeployment); + if (error) + return "patchDeployment." + 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 UpdatePatchDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.UpdatePatchDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.UpdatePatchDeploymentRequest} UpdatePatchDeploymentRequest + */ + UpdatePatchDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.UpdatePatchDeploymentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.UpdatePatchDeploymentRequest(); + if (object.patchDeployment != null) { + if (typeof object.patchDeployment !== "object") + throw TypeError(".google.cloud.osconfig.v1.UpdatePatchDeploymentRequest.patchDeployment: object expected"); + message.patchDeployment = $root.google.cloud.osconfig.v1.PatchDeployment.fromObject(object.patchDeployment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.osconfig.v1.UpdatePatchDeploymentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdatePatchDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.UpdatePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.UpdatePatchDeploymentRequest} message UpdatePatchDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePatchDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.patchDeployment = null; + object.updateMask = null; + } + if (message.patchDeployment != null && message.hasOwnProperty("patchDeployment")) + object.patchDeployment = $root.google.cloud.osconfig.v1.PatchDeployment.toObject(message.patchDeployment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdatePatchDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.UpdatePatchDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePatchDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePatchDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.UpdatePatchDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePatchDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.UpdatePatchDeploymentRequest"; + }; + + return UpdatePatchDeploymentRequest; + })(); + + v1.PausePatchDeploymentRequest = (function() { + + /** + * Properties of a PausePatchDeploymentRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IPausePatchDeploymentRequest + * @property {string|null} [name] PausePatchDeploymentRequest name + */ + + /** + * Constructs a new PausePatchDeploymentRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a PausePatchDeploymentRequest. + * @implements IPausePatchDeploymentRequest + * @constructor + * @param {google.cloud.osconfig.v1.IPausePatchDeploymentRequest=} [properties] Properties to set + */ + function PausePatchDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PausePatchDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.PausePatchDeploymentRequest + * @instance + */ + PausePatchDeploymentRequest.prototype.name = ""; + + /** + * Creates a new PausePatchDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.PausePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IPausePatchDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.PausePatchDeploymentRequest} PausePatchDeploymentRequest instance + */ + PausePatchDeploymentRequest.create = function create(properties) { + return new PausePatchDeploymentRequest(properties); + }; + + /** + * Encodes the specified PausePatchDeploymentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.PausePatchDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.PausePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IPausePatchDeploymentRequest} message PausePatchDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PausePatchDeploymentRequest.encode = function encode(message, writer) { + 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 PausePatchDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PausePatchDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.PausePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IPausePatchDeploymentRequest} message PausePatchDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PausePatchDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PausePatchDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.PausePatchDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.PausePatchDeploymentRequest} PausePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PausePatchDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.PausePatchDeploymentRequest(); + 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 PausePatchDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.PausePatchDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.PausePatchDeploymentRequest} PausePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PausePatchDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PausePatchDeploymentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.PausePatchDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PausePatchDeploymentRequest.verify = function verify(message) { + if (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 PausePatchDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.PausePatchDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.PausePatchDeploymentRequest} PausePatchDeploymentRequest + */ + PausePatchDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.PausePatchDeploymentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.PausePatchDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a PausePatchDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.PausePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.PausePatchDeploymentRequest} message PausePatchDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PausePatchDeploymentRequest.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 PausePatchDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.PausePatchDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + PausePatchDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PausePatchDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.PausePatchDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PausePatchDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.PausePatchDeploymentRequest"; + }; + + return PausePatchDeploymentRequest; + })(); + + v1.ResumePatchDeploymentRequest = (function() { + + /** + * Properties of a ResumePatchDeploymentRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IResumePatchDeploymentRequest + * @property {string|null} [name] ResumePatchDeploymentRequest name + */ + + /** + * Constructs a new ResumePatchDeploymentRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ResumePatchDeploymentRequest. + * @implements IResumePatchDeploymentRequest + * @constructor + * @param {google.cloud.osconfig.v1.IResumePatchDeploymentRequest=} [properties] Properties to set + */ + function ResumePatchDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResumePatchDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.ResumePatchDeploymentRequest + * @instance + */ + ResumePatchDeploymentRequest.prototype.name = ""; + + /** + * Creates a new ResumePatchDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ResumePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IResumePatchDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ResumePatchDeploymentRequest} ResumePatchDeploymentRequest instance + */ + ResumePatchDeploymentRequest.create = function create(properties) { + return new ResumePatchDeploymentRequest(properties); + }; + + /** + * Encodes the specified ResumePatchDeploymentRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ResumePatchDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ResumePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IResumePatchDeploymentRequest} message ResumePatchDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumePatchDeploymentRequest.encode = function encode(message, writer) { + 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 ResumePatchDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ResumePatchDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ResumePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.IResumePatchDeploymentRequest} message ResumePatchDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumePatchDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResumePatchDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ResumePatchDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ResumePatchDeploymentRequest} ResumePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumePatchDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ResumePatchDeploymentRequest(); + 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 ResumePatchDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ResumePatchDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ResumePatchDeploymentRequest} ResumePatchDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumePatchDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResumePatchDeploymentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.ResumePatchDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResumePatchDeploymentRequest.verify = function verify(message) { + if (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 ResumePatchDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ResumePatchDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ResumePatchDeploymentRequest} ResumePatchDeploymentRequest + */ + ResumePatchDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ResumePatchDeploymentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.ResumePatchDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ResumePatchDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ResumePatchDeploymentRequest + * @static + * @param {google.cloud.osconfig.v1.ResumePatchDeploymentRequest} message ResumePatchDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResumePatchDeploymentRequest.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 ResumePatchDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ResumePatchDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + ResumePatchDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResumePatchDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ResumePatchDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResumePatchDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ResumePatchDeploymentRequest"; + }; + + return ResumePatchDeploymentRequest; + })(); + + v1.ExecutePatchJobRequest = (function() { + + /** + * Properties of an ExecutePatchJobRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IExecutePatchJobRequest + * @property {string|null} [parent] ExecutePatchJobRequest parent + * @property {string|null} [description] ExecutePatchJobRequest description + * @property {google.cloud.osconfig.v1.IPatchInstanceFilter|null} [instanceFilter] ExecutePatchJobRequest instanceFilter + * @property {google.cloud.osconfig.v1.IPatchConfig|null} [patchConfig] ExecutePatchJobRequest patchConfig + * @property {google.protobuf.IDuration|null} [duration] ExecutePatchJobRequest duration + * @property {boolean|null} [dryRun] ExecutePatchJobRequest dryRun + * @property {string|null} [displayName] ExecutePatchJobRequest displayName + * @property {google.cloud.osconfig.v1.IPatchRollout|null} [rollout] ExecutePatchJobRequest rollout + */ + + /** + * Constructs a new ExecutePatchJobRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an ExecutePatchJobRequest. + * @implements IExecutePatchJobRequest + * @constructor + * @param {google.cloud.osconfig.v1.IExecutePatchJobRequest=} [properties] Properties to set + */ + function ExecutePatchJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecutePatchJobRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @instance + */ + ExecutePatchJobRequest.prototype.parent = ""; + + /** + * ExecutePatchJobRequest description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @instance + */ + ExecutePatchJobRequest.prototype.description = ""; + + /** + * ExecutePatchJobRequest instanceFilter. + * @member {google.cloud.osconfig.v1.IPatchInstanceFilter|null|undefined} instanceFilter + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @instance + */ + ExecutePatchJobRequest.prototype.instanceFilter = null; + + /** + * ExecutePatchJobRequest patchConfig. + * @member {google.cloud.osconfig.v1.IPatchConfig|null|undefined} patchConfig + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @instance + */ + ExecutePatchJobRequest.prototype.patchConfig = null; + + /** + * ExecutePatchJobRequest duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @instance + */ + ExecutePatchJobRequest.prototype.duration = null; + + /** + * ExecutePatchJobRequest dryRun. + * @member {boolean} dryRun + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @instance + */ + ExecutePatchJobRequest.prototype.dryRun = false; + + /** + * ExecutePatchJobRequest displayName. + * @member {string} displayName + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @instance + */ + ExecutePatchJobRequest.prototype.displayName = ""; + + /** + * ExecutePatchJobRequest rollout. + * @member {google.cloud.osconfig.v1.IPatchRollout|null|undefined} rollout + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @instance + */ + ExecutePatchJobRequest.prototype.rollout = null; + + /** + * Creates a new ExecutePatchJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @static + * @param {google.cloud.osconfig.v1.IExecutePatchJobRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ExecutePatchJobRequest} ExecutePatchJobRequest instance + */ + ExecutePatchJobRequest.create = function create(properties) { + return new ExecutePatchJobRequest(properties); + }; + + /** + * Encodes the specified ExecutePatchJobRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ExecutePatchJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @static + * @param {google.cloud.osconfig.v1.IExecutePatchJobRequest} message ExecutePatchJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutePatchJobRequest.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.patchConfig != null && Object.hasOwnProperty.call(message, "patchConfig")) + $root.google.cloud.osconfig.v1.PatchConfig.encode(message.patchConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.dryRun); + if (message.instanceFilter != null && Object.hasOwnProperty.call(message, "instanceFilter")) + $root.google.cloud.osconfig.v1.PatchInstanceFilter.encode(message.instanceFilter, 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); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + $root.google.cloud.osconfig.v1.PatchRollout.encode(message.rollout, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecutePatchJobRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ExecutePatchJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @static + * @param {google.cloud.osconfig.v1.IExecutePatchJobRequest} message ExecutePatchJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutePatchJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutePatchJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ExecutePatchJobRequest} ExecutePatchJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutePatchJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ExecutePatchJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 7: { + message.instanceFilter = $root.google.cloud.osconfig.v1.PatchInstanceFilter.decode(reader, reader.uint32()); + break; + } + case 4: { + message.patchConfig = $root.google.cloud.osconfig.v1.PatchConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.dryRun = reader.bool(); + break; + } + case 8: { + message.displayName = reader.string(); + break; + } + case 9: { + message.rollout = $root.google.cloud.osconfig.v1.PatchRollout.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutePatchJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ExecutePatchJobRequest} ExecutePatchJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutePatchJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutePatchJobRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutePatchJobRequest.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.instanceFilter != null && message.hasOwnProperty("instanceFilter")) { + var error = $root.google.cloud.osconfig.v1.PatchInstanceFilter.verify(message.instanceFilter); + if (error) + return "instanceFilter." + error; + } + if (message.patchConfig != null && message.hasOwnProperty("patchConfig")) { + var error = $root.google.cloud.osconfig.v1.PatchConfig.verify(message.patchConfig); + if (error) + return "patchConfig." + error; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.dryRun != null && message.hasOwnProperty("dryRun")) + if (typeof message.dryRun !== "boolean") + return "dryRun: boolean expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.rollout != null && message.hasOwnProperty("rollout")) { + var error = $root.google.cloud.osconfig.v1.PatchRollout.verify(message.rollout); + if (error) + return "rollout." + error; + } + return null; + }; + + /** + * Creates an ExecutePatchJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ExecutePatchJobRequest} ExecutePatchJobRequest + */ + ExecutePatchJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ExecutePatchJobRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.ExecutePatchJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.description != null) + message.description = String(object.description); + if (object.instanceFilter != null) { + if (typeof object.instanceFilter !== "object") + throw TypeError(".google.cloud.osconfig.v1.ExecutePatchJobRequest.instanceFilter: object expected"); + message.instanceFilter = $root.google.cloud.osconfig.v1.PatchInstanceFilter.fromObject(object.instanceFilter); + } + if (object.patchConfig != null) { + if (typeof object.patchConfig !== "object") + throw TypeError(".google.cloud.osconfig.v1.ExecutePatchJobRequest.patchConfig: object expected"); + message.patchConfig = $root.google.cloud.osconfig.v1.PatchConfig.fromObject(object.patchConfig); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.osconfig.v1.ExecutePatchJobRequest.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.dryRun != null) + message.dryRun = Boolean(object.dryRun); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.rollout != null) { + if (typeof object.rollout !== "object") + throw TypeError(".google.cloud.osconfig.v1.ExecutePatchJobRequest.rollout: object expected"); + message.rollout = $root.google.cloud.osconfig.v1.PatchRollout.fromObject(object.rollout); + } + return message; + }; + + /** + * Creates a plain object from an ExecutePatchJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @static + * @param {google.cloud.osconfig.v1.ExecutePatchJobRequest} message ExecutePatchJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutePatchJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.description = ""; + object.patchConfig = null; + object.duration = null; + object.dryRun = false; + object.instanceFilter = null; + object.displayName = ""; + object.rollout = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.patchConfig != null && message.hasOwnProperty("patchConfig")) + object.patchConfig = $root.google.cloud.osconfig.v1.PatchConfig.toObject(message.patchConfig, options); + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.dryRun != null && message.hasOwnProperty("dryRun")) + object.dryRun = message.dryRun; + if (message.instanceFilter != null && message.hasOwnProperty("instanceFilter")) + object.instanceFilter = $root.google.cloud.osconfig.v1.PatchInstanceFilter.toObject(message.instanceFilter, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = $root.google.cloud.osconfig.v1.PatchRollout.toObject(message.rollout, options); + return object; + }; + + /** + * Converts this ExecutePatchJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @instance + * @returns {Object.} JSON object + */ + ExecutePatchJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutePatchJobRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ExecutePatchJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutePatchJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ExecutePatchJobRequest"; + }; + + return ExecutePatchJobRequest; + })(); + + v1.GetPatchJobRequest = (function() { + + /** + * Properties of a GetPatchJobRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IGetPatchJobRequest + * @property {string|null} [name] GetPatchJobRequest name + */ + + /** + * Constructs a new GetPatchJobRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a GetPatchJobRequest. + * @implements IGetPatchJobRequest + * @constructor + * @param {google.cloud.osconfig.v1.IGetPatchJobRequest=} [properties] Properties to set + */ + function GetPatchJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPatchJobRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.GetPatchJobRequest + * @instance + */ + GetPatchJobRequest.prototype.name = ""; + + /** + * Creates a new GetPatchJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.GetPatchJobRequest + * @static + * @param {google.cloud.osconfig.v1.IGetPatchJobRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.GetPatchJobRequest} GetPatchJobRequest instance + */ + GetPatchJobRequest.create = function create(properties) { + return new GetPatchJobRequest(properties); + }; + + /** + * Encodes the specified GetPatchJobRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetPatchJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.GetPatchJobRequest + * @static + * @param {google.cloud.osconfig.v1.IGetPatchJobRequest} message GetPatchJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPatchJobRequest.encode = function encode(message, writer) { + 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 GetPatchJobRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetPatchJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.GetPatchJobRequest + * @static + * @param {google.cloud.osconfig.v1.IGetPatchJobRequest} message GetPatchJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPatchJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPatchJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.GetPatchJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.GetPatchJobRequest} GetPatchJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPatchJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.GetPatchJobRequest(); + 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 GetPatchJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.GetPatchJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.GetPatchJobRequest} GetPatchJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPatchJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPatchJobRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.GetPatchJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPatchJobRequest.verify = function verify(message) { + if (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 GetPatchJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.GetPatchJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.GetPatchJobRequest} GetPatchJobRequest + */ + GetPatchJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.GetPatchJobRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.GetPatchJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPatchJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.GetPatchJobRequest + * @static + * @param {google.cloud.osconfig.v1.GetPatchJobRequest} message GetPatchJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPatchJobRequest.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 GetPatchJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.GetPatchJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetPatchJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPatchJobRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.GetPatchJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPatchJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.GetPatchJobRequest"; + }; + + return GetPatchJobRequest; + })(); + + v1.ListPatchJobInstanceDetailsRequest = (function() { + + /** + * Properties of a ListPatchJobInstanceDetailsRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IListPatchJobInstanceDetailsRequest + * @property {string|null} [parent] ListPatchJobInstanceDetailsRequest parent + * @property {number|null} [pageSize] ListPatchJobInstanceDetailsRequest pageSize + * @property {string|null} [pageToken] ListPatchJobInstanceDetailsRequest pageToken + * @property {string|null} [filter] ListPatchJobInstanceDetailsRequest filter + */ + + /** + * Constructs a new ListPatchJobInstanceDetailsRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListPatchJobInstanceDetailsRequest. + * @implements IListPatchJobInstanceDetailsRequest + * @constructor + * @param {google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest=} [properties] Properties to set + */ + function ListPatchJobInstanceDetailsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPatchJobInstanceDetailsRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @instance + */ + ListPatchJobInstanceDetailsRequest.prototype.parent = ""; + + /** + * ListPatchJobInstanceDetailsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @instance + */ + ListPatchJobInstanceDetailsRequest.prototype.pageSize = 0; + + /** + * ListPatchJobInstanceDetailsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @instance + */ + ListPatchJobInstanceDetailsRequest.prototype.pageToken = ""; + + /** + * ListPatchJobInstanceDetailsRequest filter. + * @member {string} filter + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @instance + */ + ListPatchJobInstanceDetailsRequest.prototype.filter = ""; + + /** + * Creates a new ListPatchJobInstanceDetailsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @static + * @param {google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest} ListPatchJobInstanceDetailsRequest instance + */ + ListPatchJobInstanceDetailsRequest.create = function create(properties) { + return new ListPatchJobInstanceDetailsRequest(properties); + }; + + /** + * Encodes the specified ListPatchJobInstanceDetailsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @static + * @param {google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest} message ListPatchJobInstanceDetailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPatchJobInstanceDetailsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListPatchJobInstanceDetailsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @static + * @param {google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest} message ListPatchJobInstanceDetailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPatchJobInstanceDetailsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPatchJobInstanceDetailsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest} ListPatchJobInstanceDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPatchJobInstanceDetailsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPatchJobInstanceDetailsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest} ListPatchJobInstanceDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPatchJobInstanceDetailsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPatchJobInstanceDetailsRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPatchJobInstanceDetailsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListPatchJobInstanceDetailsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest} ListPatchJobInstanceDetailsRequest + */ + ListPatchJobInstanceDetailsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListPatchJobInstanceDetailsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @static + * @param {google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest} message ListPatchJobInstanceDetailsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPatchJobInstanceDetailsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListPatchJobInstanceDetailsRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPatchJobInstanceDetailsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPatchJobInstanceDetailsRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPatchJobInstanceDetailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest"; + }; + + return ListPatchJobInstanceDetailsRequest; + })(); + + v1.ListPatchJobInstanceDetailsResponse = (function() { + + /** + * Properties of a ListPatchJobInstanceDetailsResponse. + * @memberof google.cloud.osconfig.v1 + * @interface IListPatchJobInstanceDetailsResponse + * @property {Array.|null} [patchJobInstanceDetails] ListPatchJobInstanceDetailsResponse patchJobInstanceDetails + * @property {string|null} [nextPageToken] ListPatchJobInstanceDetailsResponse nextPageToken + */ + + /** + * Constructs a new ListPatchJobInstanceDetailsResponse. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListPatchJobInstanceDetailsResponse. + * @implements IListPatchJobInstanceDetailsResponse + * @constructor + * @param {google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse=} [properties] Properties to set + */ + function ListPatchJobInstanceDetailsResponse(properties) { + this.patchJobInstanceDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPatchJobInstanceDetailsResponse patchJobInstanceDetails. + * @member {Array.} patchJobInstanceDetails + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse + * @instance + */ + ListPatchJobInstanceDetailsResponse.prototype.patchJobInstanceDetails = $util.emptyArray; + + /** + * ListPatchJobInstanceDetailsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse + * @instance + */ + ListPatchJobInstanceDetailsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPatchJobInstanceDetailsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse + * @static + * @param {google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse} ListPatchJobInstanceDetailsResponse instance + */ + ListPatchJobInstanceDetailsResponse.create = function create(properties) { + return new ListPatchJobInstanceDetailsResponse(properties); + }; + + /** + * Encodes the specified ListPatchJobInstanceDetailsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse + * @static + * @param {google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse} message ListPatchJobInstanceDetailsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPatchJobInstanceDetailsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.patchJobInstanceDetails != null && message.patchJobInstanceDetails.length) + for (var i = 0; i < message.patchJobInstanceDetails.length; ++i) + $root.google.cloud.osconfig.v1.PatchJobInstanceDetails.encode(message.patchJobInstanceDetails[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 ListPatchJobInstanceDetailsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse + * @static + * @param {google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse} message ListPatchJobInstanceDetailsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPatchJobInstanceDetailsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPatchJobInstanceDetailsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse} ListPatchJobInstanceDetailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPatchJobInstanceDetailsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.patchJobInstanceDetails && message.patchJobInstanceDetails.length)) + message.patchJobInstanceDetails = []; + message.patchJobInstanceDetails.push($root.google.cloud.osconfig.v1.PatchJobInstanceDetails.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPatchJobInstanceDetailsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse} ListPatchJobInstanceDetailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPatchJobInstanceDetailsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPatchJobInstanceDetailsResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPatchJobInstanceDetailsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.patchJobInstanceDetails != null && message.hasOwnProperty("patchJobInstanceDetails")) { + if (!Array.isArray(message.patchJobInstanceDetails)) + return "patchJobInstanceDetails: array expected"; + for (var i = 0; i < message.patchJobInstanceDetails.length; ++i) { + var error = $root.google.cloud.osconfig.v1.PatchJobInstanceDetails.verify(message.patchJobInstanceDetails[i]); + if (error) + return "patchJobInstanceDetails." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPatchJobInstanceDetailsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse} ListPatchJobInstanceDetailsResponse + */ + ListPatchJobInstanceDetailsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse) + return object; + var message = new $root.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse(); + if (object.patchJobInstanceDetails) { + if (!Array.isArray(object.patchJobInstanceDetails)) + throw TypeError(".google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse.patchJobInstanceDetails: array expected"); + message.patchJobInstanceDetails = []; + for (var i = 0; i < object.patchJobInstanceDetails.length; ++i) { + if (typeof object.patchJobInstanceDetails[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse.patchJobInstanceDetails: object expected"); + message.patchJobInstanceDetails[i] = $root.google.cloud.osconfig.v1.PatchJobInstanceDetails.fromObject(object.patchJobInstanceDetails[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPatchJobInstanceDetailsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse + * @static + * @param {google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse} message ListPatchJobInstanceDetailsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPatchJobInstanceDetailsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.patchJobInstanceDetails = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.patchJobInstanceDetails && message.patchJobInstanceDetails.length) { + object.patchJobInstanceDetails = []; + for (var j = 0; j < message.patchJobInstanceDetails.length; ++j) + object.patchJobInstanceDetails[j] = $root.google.cloud.osconfig.v1.PatchJobInstanceDetails.toObject(message.patchJobInstanceDetails[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPatchJobInstanceDetailsResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPatchJobInstanceDetailsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPatchJobInstanceDetailsResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPatchJobInstanceDetailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse"; + }; + + return ListPatchJobInstanceDetailsResponse; + })(); + + v1.PatchJobInstanceDetails = (function() { + + /** + * Properties of a PatchJobInstanceDetails. + * @memberof google.cloud.osconfig.v1 + * @interface IPatchJobInstanceDetails + * @property {string|null} [name] PatchJobInstanceDetails name + * @property {string|null} [instanceSystemId] PatchJobInstanceDetails instanceSystemId + * @property {google.cloud.osconfig.v1.Instance.PatchState|null} [state] PatchJobInstanceDetails state + * @property {string|null} [failureReason] PatchJobInstanceDetails failureReason + * @property {number|Long|null} [attemptCount] PatchJobInstanceDetails attemptCount + */ + + /** + * Constructs a new PatchJobInstanceDetails. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a PatchJobInstanceDetails. + * @implements IPatchJobInstanceDetails + * @constructor + * @param {google.cloud.osconfig.v1.IPatchJobInstanceDetails=} [properties] Properties to set + */ + function PatchJobInstanceDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchJobInstanceDetails name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @instance + */ + PatchJobInstanceDetails.prototype.name = ""; + + /** + * PatchJobInstanceDetails instanceSystemId. + * @member {string} instanceSystemId + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @instance + */ + PatchJobInstanceDetails.prototype.instanceSystemId = ""; + + /** + * PatchJobInstanceDetails state. + * @member {google.cloud.osconfig.v1.Instance.PatchState} state + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @instance + */ + PatchJobInstanceDetails.prototype.state = 0; + + /** + * PatchJobInstanceDetails failureReason. + * @member {string} failureReason + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @instance + */ + PatchJobInstanceDetails.prototype.failureReason = ""; + + /** + * PatchJobInstanceDetails attemptCount. + * @member {number|Long} attemptCount + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @instance + */ + PatchJobInstanceDetails.prototype.attemptCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PatchJobInstanceDetails instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @static + * @param {google.cloud.osconfig.v1.IPatchJobInstanceDetails=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.PatchJobInstanceDetails} PatchJobInstanceDetails instance + */ + PatchJobInstanceDetails.create = function create(properties) { + return new PatchJobInstanceDetails(properties); + }; + + /** + * Encodes the specified PatchJobInstanceDetails message. Does not implicitly {@link google.cloud.osconfig.v1.PatchJobInstanceDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @static + * @param {google.cloud.osconfig.v1.IPatchJobInstanceDetails} message PatchJobInstanceDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchJobInstanceDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.instanceSystemId != null && Object.hasOwnProperty.call(message, "instanceSystemId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceSystemId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.failureReason != null && Object.hasOwnProperty.call(message, "failureReason")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.failureReason); + if (message.attemptCount != null && Object.hasOwnProperty.call(message, "attemptCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.attemptCount); + return writer; + }; + + /** + * Encodes the specified PatchJobInstanceDetails message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchJobInstanceDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @static + * @param {google.cloud.osconfig.v1.IPatchJobInstanceDetails} message PatchJobInstanceDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchJobInstanceDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchJobInstanceDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.PatchJobInstanceDetails} PatchJobInstanceDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchJobInstanceDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.PatchJobInstanceDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.instanceSystemId = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.failureReason = reader.string(); + break; + } + case 5: { + message.attemptCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchJobInstanceDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.PatchJobInstanceDetails} PatchJobInstanceDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchJobInstanceDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchJobInstanceDetails message. + * @function verify + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchJobInstanceDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.instanceSystemId != null && message.hasOwnProperty("instanceSystemId")) + if (!$util.isString(message.instanceSystemId)) + return "instanceSystemId: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.failureReason != null && message.hasOwnProperty("failureReason")) + if (!$util.isString(message.failureReason)) + return "failureReason: string expected"; + if (message.attemptCount != null && message.hasOwnProperty("attemptCount")) + if (!$util.isInteger(message.attemptCount) && !(message.attemptCount && $util.isInteger(message.attemptCount.low) && $util.isInteger(message.attemptCount.high))) + return "attemptCount: integer|Long expected"; + return null; + }; + + /** + * Creates a PatchJobInstanceDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.PatchJobInstanceDetails} PatchJobInstanceDetails + */ + PatchJobInstanceDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.PatchJobInstanceDetails) + return object; + var message = new $root.google.cloud.osconfig.v1.PatchJobInstanceDetails(); + if (object.name != null) + message.name = String(object.name); + if (object.instanceSystemId != null) + message.instanceSystemId = String(object.instanceSystemId); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "PATCH_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + case "NOTIFIED": + case 3: + message.state = 3; + break; + case "STARTED": + case 4: + message.state = 4; + break; + case "DOWNLOADING_PATCHES": + case 5: + message.state = 5; + break; + case "APPLYING_PATCHES": + case 6: + message.state = 6; + break; + case "REBOOTING": + case 7: + message.state = 7; + break; + case "SUCCEEDED": + case 8: + message.state = 8; + break; + case "SUCCEEDED_REBOOT_REQUIRED": + case 9: + message.state = 9; + break; + case "FAILED": + case 10: + message.state = 10; + break; + case "ACKED": + case 11: + message.state = 11; + break; + case "TIMED_OUT": + case 12: + message.state = 12; + break; + case "RUNNING_PRE_PATCH_STEP": + case 13: + message.state = 13; + break; + case "RUNNING_POST_PATCH_STEP": + case 14: + message.state = 14; + break; + case "NO_AGENT_DETECTED": + case 15: + message.state = 15; + break; + } + if (object.failureReason != null) + message.failureReason = String(object.failureReason); + if (object.attemptCount != null) + if ($util.Long) + (message.attemptCount = $util.Long.fromValue(object.attemptCount)).unsigned = false; + else if (typeof object.attemptCount === "string") + message.attemptCount = parseInt(object.attemptCount, 10); + else if (typeof object.attemptCount === "number") + message.attemptCount = object.attemptCount; + else if (typeof object.attemptCount === "object") + message.attemptCount = new $util.LongBits(object.attemptCount.low >>> 0, object.attemptCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PatchJobInstanceDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @static + * @param {google.cloud.osconfig.v1.PatchJobInstanceDetails} message PatchJobInstanceDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchJobInstanceDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.instanceSystemId = ""; + object.state = options.enums === String ? "PATCH_STATE_UNSPECIFIED" : 0; + object.failureReason = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.attemptCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.attemptCount = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.instanceSystemId != null && message.hasOwnProperty("instanceSystemId")) + object.instanceSystemId = message.instanceSystemId; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.osconfig.v1.Instance.PatchState[message.state] === undefined ? message.state : $root.google.cloud.osconfig.v1.Instance.PatchState[message.state] : message.state; + if (message.failureReason != null && message.hasOwnProperty("failureReason")) + object.failureReason = message.failureReason; + if (message.attemptCount != null && message.hasOwnProperty("attemptCount")) + if (typeof message.attemptCount === "number") + object.attemptCount = options.longs === String ? String(message.attemptCount) : message.attemptCount; + else + object.attemptCount = options.longs === String ? $util.Long.prototype.toString.call(message.attemptCount) : options.longs === Number ? new $util.LongBits(message.attemptCount.low >>> 0, message.attemptCount.high >>> 0).toNumber() : message.attemptCount; + return object; + }; + + /** + * Converts this PatchJobInstanceDetails to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @instance + * @returns {Object.} JSON object + */ + PatchJobInstanceDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PatchJobInstanceDetails + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.PatchJobInstanceDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PatchJobInstanceDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.PatchJobInstanceDetails"; + }; + + return PatchJobInstanceDetails; + })(); + + v1.ListPatchJobsRequest = (function() { + + /** + * Properties of a ListPatchJobsRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IListPatchJobsRequest + * @property {string|null} [parent] ListPatchJobsRequest parent + * @property {number|null} [pageSize] ListPatchJobsRequest pageSize + * @property {string|null} [pageToken] ListPatchJobsRequest pageToken + * @property {string|null} [filter] ListPatchJobsRequest filter + */ + + /** + * Constructs a new ListPatchJobsRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListPatchJobsRequest. + * @implements IListPatchJobsRequest + * @constructor + * @param {google.cloud.osconfig.v1.IListPatchJobsRequest=} [properties] Properties to set + */ + function ListPatchJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPatchJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @instance + */ + ListPatchJobsRequest.prototype.parent = ""; + + /** + * ListPatchJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @instance + */ + ListPatchJobsRequest.prototype.pageSize = 0; + + /** + * ListPatchJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @instance + */ + ListPatchJobsRequest.prototype.pageToken = ""; + + /** + * ListPatchJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @instance + */ + ListPatchJobsRequest.prototype.filter = ""; + + /** + * Creates a new ListPatchJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @static + * @param {google.cloud.osconfig.v1.IListPatchJobsRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListPatchJobsRequest} ListPatchJobsRequest instance + */ + ListPatchJobsRequest.create = function create(properties) { + return new ListPatchJobsRequest(properties); + }; + + /** + * Encodes the specified ListPatchJobsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @static + * @param {google.cloud.osconfig.v1.IListPatchJobsRequest} message ListPatchJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPatchJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListPatchJobsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @static + * @param {google.cloud.osconfig.v1.IListPatchJobsRequest} message ListPatchJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPatchJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPatchJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListPatchJobsRequest} ListPatchJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPatchJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListPatchJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPatchJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListPatchJobsRequest} ListPatchJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPatchJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPatchJobsRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPatchJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListPatchJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListPatchJobsRequest} ListPatchJobsRequest + */ + ListPatchJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListPatchJobsRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.ListPatchJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListPatchJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @static + * @param {google.cloud.osconfig.v1.ListPatchJobsRequest} message ListPatchJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPatchJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListPatchJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPatchJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPatchJobsRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListPatchJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPatchJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListPatchJobsRequest"; + }; + + return ListPatchJobsRequest; + })(); + + v1.ListPatchJobsResponse = (function() { + + /** + * Properties of a ListPatchJobsResponse. + * @memberof google.cloud.osconfig.v1 + * @interface IListPatchJobsResponse + * @property {Array.|null} [patchJobs] ListPatchJobsResponse patchJobs + * @property {string|null} [nextPageToken] ListPatchJobsResponse nextPageToken + */ + + /** + * Constructs a new ListPatchJobsResponse. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListPatchJobsResponse. + * @implements IListPatchJobsResponse + * @constructor + * @param {google.cloud.osconfig.v1.IListPatchJobsResponse=} [properties] Properties to set + */ + function ListPatchJobsResponse(properties) { + this.patchJobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPatchJobsResponse patchJobs. + * @member {Array.} patchJobs + * @memberof google.cloud.osconfig.v1.ListPatchJobsResponse + * @instance + */ + ListPatchJobsResponse.prototype.patchJobs = $util.emptyArray; + + /** + * ListPatchJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1.ListPatchJobsResponse + * @instance + */ + ListPatchJobsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPatchJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListPatchJobsResponse + * @static + * @param {google.cloud.osconfig.v1.IListPatchJobsResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListPatchJobsResponse} ListPatchJobsResponse instance + */ + ListPatchJobsResponse.create = function create(properties) { + return new ListPatchJobsResponse(properties); + }; + + /** + * Encodes the specified ListPatchJobsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListPatchJobsResponse + * @static + * @param {google.cloud.osconfig.v1.IListPatchJobsResponse} message ListPatchJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPatchJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.patchJobs != null && message.patchJobs.length) + for (var i = 0; i < message.patchJobs.length; ++i) + $root.google.cloud.osconfig.v1.PatchJob.encode(message.patchJobs[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 ListPatchJobsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListPatchJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListPatchJobsResponse + * @static + * @param {google.cloud.osconfig.v1.IListPatchJobsResponse} message ListPatchJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPatchJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPatchJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListPatchJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListPatchJobsResponse} ListPatchJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPatchJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListPatchJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.patchJobs && message.patchJobs.length)) + message.patchJobs = []; + message.patchJobs.push($root.google.cloud.osconfig.v1.PatchJob.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPatchJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListPatchJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListPatchJobsResponse} ListPatchJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPatchJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPatchJobsResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListPatchJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPatchJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.patchJobs != null && message.hasOwnProperty("patchJobs")) { + if (!Array.isArray(message.patchJobs)) + return "patchJobs: array expected"; + for (var i = 0; i < message.patchJobs.length; ++i) { + var error = $root.google.cloud.osconfig.v1.PatchJob.verify(message.patchJobs[i]); + if (error) + return "patchJobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPatchJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListPatchJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListPatchJobsResponse} ListPatchJobsResponse + */ + ListPatchJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListPatchJobsResponse) + return object; + var message = new $root.google.cloud.osconfig.v1.ListPatchJobsResponse(); + if (object.patchJobs) { + if (!Array.isArray(object.patchJobs)) + throw TypeError(".google.cloud.osconfig.v1.ListPatchJobsResponse.patchJobs: array expected"); + message.patchJobs = []; + for (var i = 0; i < object.patchJobs.length; ++i) { + if (typeof object.patchJobs[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.ListPatchJobsResponse.patchJobs: object expected"); + message.patchJobs[i] = $root.google.cloud.osconfig.v1.PatchJob.fromObject(object.patchJobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPatchJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListPatchJobsResponse + * @static + * @param {google.cloud.osconfig.v1.ListPatchJobsResponse} message ListPatchJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPatchJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.patchJobs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.patchJobs && message.patchJobs.length) { + object.patchJobs = []; + for (var j = 0; j < message.patchJobs.length; ++j) + object.patchJobs[j] = $root.google.cloud.osconfig.v1.PatchJob.toObject(message.patchJobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPatchJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListPatchJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPatchJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPatchJobsResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListPatchJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPatchJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListPatchJobsResponse"; + }; + + return ListPatchJobsResponse; + })(); + + v1.PatchJob = (function() { + + /** + * Properties of a PatchJob. + * @memberof google.cloud.osconfig.v1 + * @interface IPatchJob + * @property {string|null} [name] PatchJob name + * @property {string|null} [displayName] PatchJob displayName + * @property {string|null} [description] PatchJob description + * @property {google.protobuf.ITimestamp|null} [createTime] PatchJob createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] PatchJob updateTime + * @property {google.cloud.osconfig.v1.PatchJob.State|null} [state] PatchJob state + * @property {google.cloud.osconfig.v1.IPatchInstanceFilter|null} [instanceFilter] PatchJob instanceFilter + * @property {google.cloud.osconfig.v1.IPatchConfig|null} [patchConfig] PatchJob patchConfig + * @property {google.protobuf.IDuration|null} [duration] PatchJob duration + * @property {google.cloud.osconfig.v1.PatchJob.IInstanceDetailsSummary|null} [instanceDetailsSummary] PatchJob instanceDetailsSummary + * @property {boolean|null} [dryRun] PatchJob dryRun + * @property {string|null} [errorMessage] PatchJob errorMessage + * @property {number|null} [percentComplete] PatchJob percentComplete + * @property {string|null} [patchDeployment] PatchJob patchDeployment + * @property {google.cloud.osconfig.v1.IPatchRollout|null} [rollout] PatchJob rollout + */ + + /** + * Constructs a new PatchJob. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a PatchJob. + * @implements IPatchJob + * @constructor + * @param {google.cloud.osconfig.v1.IPatchJob=} [properties] Properties to set + */ + function PatchJob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchJob name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.name = ""; + + /** + * PatchJob displayName. + * @member {string} displayName + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.displayName = ""; + + /** + * PatchJob description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.description = ""; + + /** + * PatchJob createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.createTime = null; + + /** + * PatchJob updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.updateTime = null; + + /** + * PatchJob state. + * @member {google.cloud.osconfig.v1.PatchJob.State} state + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.state = 0; + + /** + * PatchJob instanceFilter. + * @member {google.cloud.osconfig.v1.IPatchInstanceFilter|null|undefined} instanceFilter + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.instanceFilter = null; + + /** + * PatchJob patchConfig. + * @member {google.cloud.osconfig.v1.IPatchConfig|null|undefined} patchConfig + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.patchConfig = null; + + /** + * PatchJob duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.duration = null; + + /** + * PatchJob instanceDetailsSummary. + * @member {google.cloud.osconfig.v1.PatchJob.IInstanceDetailsSummary|null|undefined} instanceDetailsSummary + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.instanceDetailsSummary = null; + + /** + * PatchJob dryRun. + * @member {boolean} dryRun + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.dryRun = false; + + /** + * PatchJob errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.errorMessage = ""; + + /** + * PatchJob percentComplete. + * @member {number} percentComplete + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.percentComplete = 0; + + /** + * PatchJob patchDeployment. + * @member {string} patchDeployment + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.patchDeployment = ""; + + /** + * PatchJob rollout. + * @member {google.cloud.osconfig.v1.IPatchRollout|null|undefined} rollout + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + */ + PatchJob.prototype.rollout = null; + + /** + * Creates a new PatchJob instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.PatchJob + * @static + * @param {google.cloud.osconfig.v1.IPatchJob=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.PatchJob} PatchJob instance + */ + PatchJob.create = function create(properties) { + return new PatchJob(properties); + }; + + /** + * Encodes the specified PatchJob message. Does not implicitly {@link google.cloud.osconfig.v1.PatchJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.PatchJob + * @static + * @param {google.cloud.osconfig.v1.IPatchJob} message PatchJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.patchConfig != null && Object.hasOwnProperty.call(message, "patchConfig")) + $root.google.cloud.osconfig.v1.PatchConfig.encode(message.patchConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.instanceDetailsSummary != null && Object.hasOwnProperty.call(message, "instanceDetailsSummary")) + $root.google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary.encode(message.instanceDetailsSummary, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.dryRun); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.errorMessage); + if (message.percentComplete != null && Object.hasOwnProperty.call(message, "percentComplete")) + writer.uint32(/* id 12, wireType 1 =*/97).double(message.percentComplete); + if (message.instanceFilter != null && Object.hasOwnProperty.call(message, "instanceFilter")) + $root.google.cloud.osconfig.v1.PatchInstanceFilter.encode(message.instanceFilter, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.displayName); + if (message.patchDeployment != null && Object.hasOwnProperty.call(message, "patchDeployment")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.patchDeployment); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + $root.google.cloud.osconfig.v1.PatchRollout.encode(message.rollout, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchJob message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.PatchJob + * @static + * @param {google.cloud.osconfig.v1.IPatchJob} message PatchJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.PatchJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.PatchJob} PatchJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchJob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.PatchJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 14: { + message.displayName = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 13: { + message.instanceFilter = $root.google.cloud.osconfig.v1.PatchInstanceFilter.decode(reader, reader.uint32()); + break; + } + case 7: { + message.patchConfig = $root.google.cloud.osconfig.v1.PatchConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.instanceDetailsSummary = $root.google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary.decode(reader, reader.uint32()); + break; + } + case 10: { + message.dryRun = reader.bool(); + break; + } + case 11: { + message.errorMessage = reader.string(); + break; + } + case 12: { + message.percentComplete = reader.double(); + break; + } + case 15: { + message.patchDeployment = reader.string(); + break; + } + case 16: { + message.rollout = $root.google.cloud.osconfig.v1.PatchRollout.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.PatchJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.PatchJob} PatchJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchJob message. + * @function verify + * @memberof google.cloud.osconfig.v1.PatchJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.instanceFilter != null && message.hasOwnProperty("instanceFilter")) { + var error = $root.google.cloud.osconfig.v1.PatchInstanceFilter.verify(message.instanceFilter); + if (error) + return "instanceFilter." + error; + } + if (message.patchConfig != null && message.hasOwnProperty("patchConfig")) { + var error = $root.google.cloud.osconfig.v1.PatchConfig.verify(message.patchConfig); + if (error) + return "patchConfig." + error; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.instanceDetailsSummary != null && message.hasOwnProperty("instanceDetailsSummary")) { + var error = $root.google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary.verify(message.instanceDetailsSummary); + if (error) + return "instanceDetailsSummary." + error; + } + if (message.dryRun != null && message.hasOwnProperty("dryRun")) + if (typeof message.dryRun !== "boolean") + return "dryRun: boolean expected"; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + if (message.percentComplete != null && message.hasOwnProperty("percentComplete")) + if (typeof message.percentComplete !== "number") + return "percentComplete: number expected"; + if (message.patchDeployment != null && message.hasOwnProperty("patchDeployment")) + if (!$util.isString(message.patchDeployment)) + return "patchDeployment: string expected"; + if (message.rollout != null && message.hasOwnProperty("rollout")) { + var error = $root.google.cloud.osconfig.v1.PatchRollout.verify(message.rollout); + if (error) + return "rollout." + error; + } + return null; + }; + + /** + * Creates a PatchJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.PatchJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.PatchJob} PatchJob + */ + PatchJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.PatchJob) + return object; + var message = new $root.google.cloud.osconfig.v1.PatchJob(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchJob.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.osconfig.v1.PatchJob.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "STARTED": + case 1: + message.state = 1; + break; + case "INSTANCE_LOOKUP": + case 2: + message.state = 2; + break; + case "PATCHING": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "COMPLETED_WITH_ERRORS": + case 5: + message.state = 5; + break; + case "CANCELED": + case 6: + message.state = 6; + break; + case "TIMED_OUT": + case 7: + message.state = 7; + break; + } + if (object.instanceFilter != null) { + if (typeof object.instanceFilter !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchJob.instanceFilter: object expected"); + message.instanceFilter = $root.google.cloud.osconfig.v1.PatchInstanceFilter.fromObject(object.instanceFilter); + } + if (object.patchConfig != null) { + if (typeof object.patchConfig !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchJob.patchConfig: object expected"); + message.patchConfig = $root.google.cloud.osconfig.v1.PatchConfig.fromObject(object.patchConfig); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchJob.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.instanceDetailsSummary != null) { + if (typeof object.instanceDetailsSummary !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchJob.instanceDetailsSummary: object expected"); + message.instanceDetailsSummary = $root.google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary.fromObject(object.instanceDetailsSummary); + } + if (object.dryRun != null) + message.dryRun = Boolean(object.dryRun); + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + if (object.percentComplete != null) + message.percentComplete = Number(object.percentComplete); + if (object.patchDeployment != null) + message.patchDeployment = String(object.patchDeployment); + if (object.rollout != null) { + if (typeof object.rollout !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchJob.rollout: object expected"); + message.rollout = $root.google.cloud.osconfig.v1.PatchRollout.fromObject(object.rollout); + } + return message; + }; + + /** + * Creates a plain object from a PatchJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.PatchJob + * @static + * @param {google.cloud.osconfig.v1.PatchJob} message PatchJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.patchConfig = null; + object.duration = null; + object.instanceDetailsSummary = null; + object.dryRun = false; + object.errorMessage = ""; + object.percentComplete = 0; + object.instanceFilter = null; + object.displayName = ""; + object.patchDeployment = ""; + object.rollout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.osconfig.v1.PatchJob.State[message.state] === undefined ? message.state : $root.google.cloud.osconfig.v1.PatchJob.State[message.state] : message.state; + if (message.patchConfig != null && message.hasOwnProperty("patchConfig")) + object.patchConfig = $root.google.cloud.osconfig.v1.PatchConfig.toObject(message.patchConfig, options); + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.instanceDetailsSummary != null && message.hasOwnProperty("instanceDetailsSummary")) + object.instanceDetailsSummary = $root.google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary.toObject(message.instanceDetailsSummary, options); + if (message.dryRun != null && message.hasOwnProperty("dryRun")) + object.dryRun = message.dryRun; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + if (message.percentComplete != null && message.hasOwnProperty("percentComplete")) + object.percentComplete = options.json && !isFinite(message.percentComplete) ? String(message.percentComplete) : message.percentComplete; + if (message.instanceFilter != null && message.hasOwnProperty("instanceFilter")) + object.instanceFilter = $root.google.cloud.osconfig.v1.PatchInstanceFilter.toObject(message.instanceFilter, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.patchDeployment != null && message.hasOwnProperty("patchDeployment")) + object.patchDeployment = message.patchDeployment; + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = $root.google.cloud.osconfig.v1.PatchRollout.toObject(message.rollout, options); + return object; + }; + + /** + * Converts this PatchJob to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.PatchJob + * @instance + * @returns {Object.} JSON object + */ + PatchJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PatchJob + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.PatchJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PatchJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.PatchJob"; + }; + + /** + * State enum. + * @name google.cloud.osconfig.v1.PatchJob.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} STARTED=1 STARTED value + * @property {number} INSTANCE_LOOKUP=2 INSTANCE_LOOKUP value + * @property {number} PATCHING=3 PATCHING value + * @property {number} SUCCEEDED=4 SUCCEEDED value + * @property {number} COMPLETED_WITH_ERRORS=5 COMPLETED_WITH_ERRORS value + * @property {number} CANCELED=6 CANCELED value + * @property {number} TIMED_OUT=7 TIMED_OUT value + */ + PatchJob.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STARTED"] = 1; + values[valuesById[2] = "INSTANCE_LOOKUP"] = 2; + values[valuesById[3] = "PATCHING"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + values[valuesById[5] = "COMPLETED_WITH_ERRORS"] = 5; + values[valuesById[6] = "CANCELED"] = 6; + values[valuesById[7] = "TIMED_OUT"] = 7; + return values; + })(); + + PatchJob.InstanceDetailsSummary = (function() { + + /** + * Properties of an InstanceDetailsSummary. + * @memberof google.cloud.osconfig.v1.PatchJob + * @interface IInstanceDetailsSummary + * @property {number|Long|null} [pendingInstanceCount] InstanceDetailsSummary pendingInstanceCount + * @property {number|Long|null} [inactiveInstanceCount] InstanceDetailsSummary inactiveInstanceCount + * @property {number|Long|null} [notifiedInstanceCount] InstanceDetailsSummary notifiedInstanceCount + * @property {number|Long|null} [startedInstanceCount] InstanceDetailsSummary startedInstanceCount + * @property {number|Long|null} [downloadingPatchesInstanceCount] InstanceDetailsSummary downloadingPatchesInstanceCount + * @property {number|Long|null} [applyingPatchesInstanceCount] InstanceDetailsSummary applyingPatchesInstanceCount + * @property {number|Long|null} [rebootingInstanceCount] InstanceDetailsSummary rebootingInstanceCount + * @property {number|Long|null} [succeededInstanceCount] InstanceDetailsSummary succeededInstanceCount + * @property {number|Long|null} [succeededRebootRequiredInstanceCount] InstanceDetailsSummary succeededRebootRequiredInstanceCount + * @property {number|Long|null} [failedInstanceCount] InstanceDetailsSummary failedInstanceCount + * @property {number|Long|null} [ackedInstanceCount] InstanceDetailsSummary ackedInstanceCount + * @property {number|Long|null} [timedOutInstanceCount] InstanceDetailsSummary timedOutInstanceCount + * @property {number|Long|null} [prePatchStepInstanceCount] InstanceDetailsSummary prePatchStepInstanceCount + * @property {number|Long|null} [postPatchStepInstanceCount] InstanceDetailsSummary postPatchStepInstanceCount + * @property {number|Long|null} [noAgentDetectedInstanceCount] InstanceDetailsSummary noAgentDetectedInstanceCount + */ + + /** + * Constructs a new InstanceDetailsSummary. + * @memberof google.cloud.osconfig.v1.PatchJob + * @classdesc Represents an InstanceDetailsSummary. + * @implements IInstanceDetailsSummary + * @constructor + * @param {google.cloud.osconfig.v1.PatchJob.IInstanceDetailsSummary=} [properties] Properties to set + */ + function InstanceDetailsSummary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceDetailsSummary pendingInstanceCount. + * @member {number|Long} pendingInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.pendingInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary inactiveInstanceCount. + * @member {number|Long} inactiveInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.inactiveInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary notifiedInstanceCount. + * @member {number|Long} notifiedInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.notifiedInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary startedInstanceCount. + * @member {number|Long} startedInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.startedInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary downloadingPatchesInstanceCount. + * @member {number|Long} downloadingPatchesInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.downloadingPatchesInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary applyingPatchesInstanceCount. + * @member {number|Long} applyingPatchesInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.applyingPatchesInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary rebootingInstanceCount. + * @member {number|Long} rebootingInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.rebootingInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary succeededInstanceCount. + * @member {number|Long} succeededInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.succeededInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary succeededRebootRequiredInstanceCount. + * @member {number|Long} succeededRebootRequiredInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.succeededRebootRequiredInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary failedInstanceCount. + * @member {number|Long} failedInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.failedInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary ackedInstanceCount. + * @member {number|Long} ackedInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.ackedInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary timedOutInstanceCount. + * @member {number|Long} timedOutInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.timedOutInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary prePatchStepInstanceCount. + * @member {number|Long} prePatchStepInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.prePatchStepInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary postPatchStepInstanceCount. + * @member {number|Long} postPatchStepInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.postPatchStepInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceDetailsSummary noAgentDetectedInstanceCount. + * @member {number|Long} noAgentDetectedInstanceCount + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + */ + InstanceDetailsSummary.prototype.noAgentDetectedInstanceCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new InstanceDetailsSummary instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @static + * @param {google.cloud.osconfig.v1.PatchJob.IInstanceDetailsSummary=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary} InstanceDetailsSummary instance + */ + InstanceDetailsSummary.create = function create(properties) { + return new InstanceDetailsSummary(properties); + }; + + /** + * Encodes the specified InstanceDetailsSummary message. Does not implicitly {@link google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @static + * @param {google.cloud.osconfig.v1.PatchJob.IInstanceDetailsSummary} message InstanceDetailsSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceDetailsSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pendingInstanceCount != null && Object.hasOwnProperty.call(message, "pendingInstanceCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.pendingInstanceCount); + if (message.inactiveInstanceCount != null && Object.hasOwnProperty.call(message, "inactiveInstanceCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.inactiveInstanceCount); + if (message.notifiedInstanceCount != null && Object.hasOwnProperty.call(message, "notifiedInstanceCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.notifiedInstanceCount); + if (message.startedInstanceCount != null && Object.hasOwnProperty.call(message, "startedInstanceCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.startedInstanceCount); + if (message.downloadingPatchesInstanceCount != null && Object.hasOwnProperty.call(message, "downloadingPatchesInstanceCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.downloadingPatchesInstanceCount); + if (message.applyingPatchesInstanceCount != null && Object.hasOwnProperty.call(message, "applyingPatchesInstanceCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.applyingPatchesInstanceCount); + if (message.rebootingInstanceCount != null && Object.hasOwnProperty.call(message, "rebootingInstanceCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.rebootingInstanceCount); + if (message.succeededInstanceCount != null && Object.hasOwnProperty.call(message, "succeededInstanceCount")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.succeededInstanceCount); + if (message.succeededRebootRequiredInstanceCount != null && Object.hasOwnProperty.call(message, "succeededRebootRequiredInstanceCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.succeededRebootRequiredInstanceCount); + if (message.failedInstanceCount != null && Object.hasOwnProperty.call(message, "failedInstanceCount")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.failedInstanceCount); + if (message.ackedInstanceCount != null && Object.hasOwnProperty.call(message, "ackedInstanceCount")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.ackedInstanceCount); + if (message.timedOutInstanceCount != null && Object.hasOwnProperty.call(message, "timedOutInstanceCount")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.timedOutInstanceCount); + if (message.prePatchStepInstanceCount != null && Object.hasOwnProperty.call(message, "prePatchStepInstanceCount")) + writer.uint32(/* id 13, wireType 0 =*/104).int64(message.prePatchStepInstanceCount); + if (message.postPatchStepInstanceCount != null && Object.hasOwnProperty.call(message, "postPatchStepInstanceCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.postPatchStepInstanceCount); + if (message.noAgentDetectedInstanceCount != null && Object.hasOwnProperty.call(message, "noAgentDetectedInstanceCount")) + writer.uint32(/* id 15, wireType 0 =*/120).int64(message.noAgentDetectedInstanceCount); + return writer; + }; + + /** + * Encodes the specified InstanceDetailsSummary message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @static + * @param {google.cloud.osconfig.v1.PatchJob.IInstanceDetailsSummary} message InstanceDetailsSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceDetailsSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceDetailsSummary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary} InstanceDetailsSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceDetailsSummary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pendingInstanceCount = reader.int64(); + break; + } + case 2: { + message.inactiveInstanceCount = reader.int64(); + break; + } + case 3: { + message.notifiedInstanceCount = reader.int64(); + break; + } + case 4: { + message.startedInstanceCount = reader.int64(); + break; + } + case 5: { + message.downloadingPatchesInstanceCount = reader.int64(); + break; + } + case 6: { + message.applyingPatchesInstanceCount = reader.int64(); + break; + } + case 7: { + message.rebootingInstanceCount = reader.int64(); + break; + } + case 8: { + message.succeededInstanceCount = reader.int64(); + break; + } + case 9: { + message.succeededRebootRequiredInstanceCount = reader.int64(); + break; + } + case 10: { + message.failedInstanceCount = reader.int64(); + break; + } + case 11: { + message.ackedInstanceCount = reader.int64(); + break; + } + case 12: { + message.timedOutInstanceCount = reader.int64(); + break; + } + case 13: { + message.prePatchStepInstanceCount = reader.int64(); + break; + } + case 14: { + message.postPatchStepInstanceCount = reader.int64(); + break; + } + case 15: { + message.noAgentDetectedInstanceCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceDetailsSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary} InstanceDetailsSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceDetailsSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceDetailsSummary message. + * @function verify + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceDetailsSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pendingInstanceCount != null && message.hasOwnProperty("pendingInstanceCount")) + if (!$util.isInteger(message.pendingInstanceCount) && !(message.pendingInstanceCount && $util.isInteger(message.pendingInstanceCount.low) && $util.isInteger(message.pendingInstanceCount.high))) + return "pendingInstanceCount: integer|Long expected"; + if (message.inactiveInstanceCount != null && message.hasOwnProperty("inactiveInstanceCount")) + if (!$util.isInteger(message.inactiveInstanceCount) && !(message.inactiveInstanceCount && $util.isInteger(message.inactiveInstanceCount.low) && $util.isInteger(message.inactiveInstanceCount.high))) + return "inactiveInstanceCount: integer|Long expected"; + if (message.notifiedInstanceCount != null && message.hasOwnProperty("notifiedInstanceCount")) + if (!$util.isInteger(message.notifiedInstanceCount) && !(message.notifiedInstanceCount && $util.isInteger(message.notifiedInstanceCount.low) && $util.isInteger(message.notifiedInstanceCount.high))) + return "notifiedInstanceCount: integer|Long expected"; + if (message.startedInstanceCount != null && message.hasOwnProperty("startedInstanceCount")) + if (!$util.isInteger(message.startedInstanceCount) && !(message.startedInstanceCount && $util.isInteger(message.startedInstanceCount.low) && $util.isInteger(message.startedInstanceCount.high))) + return "startedInstanceCount: integer|Long expected"; + if (message.downloadingPatchesInstanceCount != null && message.hasOwnProperty("downloadingPatchesInstanceCount")) + if (!$util.isInteger(message.downloadingPatchesInstanceCount) && !(message.downloadingPatchesInstanceCount && $util.isInteger(message.downloadingPatchesInstanceCount.low) && $util.isInteger(message.downloadingPatchesInstanceCount.high))) + return "downloadingPatchesInstanceCount: integer|Long expected"; + if (message.applyingPatchesInstanceCount != null && message.hasOwnProperty("applyingPatchesInstanceCount")) + if (!$util.isInteger(message.applyingPatchesInstanceCount) && !(message.applyingPatchesInstanceCount && $util.isInteger(message.applyingPatchesInstanceCount.low) && $util.isInteger(message.applyingPatchesInstanceCount.high))) + return "applyingPatchesInstanceCount: integer|Long expected"; + if (message.rebootingInstanceCount != null && message.hasOwnProperty("rebootingInstanceCount")) + if (!$util.isInteger(message.rebootingInstanceCount) && !(message.rebootingInstanceCount && $util.isInteger(message.rebootingInstanceCount.low) && $util.isInteger(message.rebootingInstanceCount.high))) + return "rebootingInstanceCount: integer|Long expected"; + if (message.succeededInstanceCount != null && message.hasOwnProperty("succeededInstanceCount")) + if (!$util.isInteger(message.succeededInstanceCount) && !(message.succeededInstanceCount && $util.isInteger(message.succeededInstanceCount.low) && $util.isInteger(message.succeededInstanceCount.high))) + return "succeededInstanceCount: integer|Long expected"; + if (message.succeededRebootRequiredInstanceCount != null && message.hasOwnProperty("succeededRebootRequiredInstanceCount")) + if (!$util.isInteger(message.succeededRebootRequiredInstanceCount) && !(message.succeededRebootRequiredInstanceCount && $util.isInteger(message.succeededRebootRequiredInstanceCount.low) && $util.isInteger(message.succeededRebootRequiredInstanceCount.high))) + return "succeededRebootRequiredInstanceCount: integer|Long expected"; + if (message.failedInstanceCount != null && message.hasOwnProperty("failedInstanceCount")) + if (!$util.isInteger(message.failedInstanceCount) && !(message.failedInstanceCount && $util.isInteger(message.failedInstanceCount.low) && $util.isInteger(message.failedInstanceCount.high))) + return "failedInstanceCount: integer|Long expected"; + if (message.ackedInstanceCount != null && message.hasOwnProperty("ackedInstanceCount")) + if (!$util.isInteger(message.ackedInstanceCount) && !(message.ackedInstanceCount && $util.isInteger(message.ackedInstanceCount.low) && $util.isInteger(message.ackedInstanceCount.high))) + return "ackedInstanceCount: integer|Long expected"; + if (message.timedOutInstanceCount != null && message.hasOwnProperty("timedOutInstanceCount")) + if (!$util.isInteger(message.timedOutInstanceCount) && !(message.timedOutInstanceCount && $util.isInteger(message.timedOutInstanceCount.low) && $util.isInteger(message.timedOutInstanceCount.high))) + return "timedOutInstanceCount: integer|Long expected"; + if (message.prePatchStepInstanceCount != null && message.hasOwnProperty("prePatchStepInstanceCount")) + if (!$util.isInteger(message.prePatchStepInstanceCount) && !(message.prePatchStepInstanceCount && $util.isInteger(message.prePatchStepInstanceCount.low) && $util.isInteger(message.prePatchStepInstanceCount.high))) + return "prePatchStepInstanceCount: integer|Long expected"; + if (message.postPatchStepInstanceCount != null && message.hasOwnProperty("postPatchStepInstanceCount")) + if (!$util.isInteger(message.postPatchStepInstanceCount) && !(message.postPatchStepInstanceCount && $util.isInteger(message.postPatchStepInstanceCount.low) && $util.isInteger(message.postPatchStepInstanceCount.high))) + return "postPatchStepInstanceCount: integer|Long expected"; + if (message.noAgentDetectedInstanceCount != null && message.hasOwnProperty("noAgentDetectedInstanceCount")) + if (!$util.isInteger(message.noAgentDetectedInstanceCount) && !(message.noAgentDetectedInstanceCount && $util.isInteger(message.noAgentDetectedInstanceCount.low) && $util.isInteger(message.noAgentDetectedInstanceCount.high))) + return "noAgentDetectedInstanceCount: integer|Long expected"; + return null; + }; + + /** + * Creates an InstanceDetailsSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary} InstanceDetailsSummary + */ + InstanceDetailsSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary) + return object; + var message = new $root.google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary(); + if (object.pendingInstanceCount != null) + if ($util.Long) + (message.pendingInstanceCount = $util.Long.fromValue(object.pendingInstanceCount)).unsigned = false; + else if (typeof object.pendingInstanceCount === "string") + message.pendingInstanceCount = parseInt(object.pendingInstanceCount, 10); + else if (typeof object.pendingInstanceCount === "number") + message.pendingInstanceCount = object.pendingInstanceCount; + else if (typeof object.pendingInstanceCount === "object") + message.pendingInstanceCount = new $util.LongBits(object.pendingInstanceCount.low >>> 0, object.pendingInstanceCount.high >>> 0).toNumber(); + if (object.inactiveInstanceCount != null) + if ($util.Long) + (message.inactiveInstanceCount = $util.Long.fromValue(object.inactiveInstanceCount)).unsigned = false; + else if (typeof object.inactiveInstanceCount === "string") + message.inactiveInstanceCount = parseInt(object.inactiveInstanceCount, 10); + else if (typeof object.inactiveInstanceCount === "number") + message.inactiveInstanceCount = object.inactiveInstanceCount; + else if (typeof object.inactiveInstanceCount === "object") + message.inactiveInstanceCount = new $util.LongBits(object.inactiveInstanceCount.low >>> 0, object.inactiveInstanceCount.high >>> 0).toNumber(); + if (object.notifiedInstanceCount != null) + if ($util.Long) + (message.notifiedInstanceCount = $util.Long.fromValue(object.notifiedInstanceCount)).unsigned = false; + else if (typeof object.notifiedInstanceCount === "string") + message.notifiedInstanceCount = parseInt(object.notifiedInstanceCount, 10); + else if (typeof object.notifiedInstanceCount === "number") + message.notifiedInstanceCount = object.notifiedInstanceCount; + else if (typeof object.notifiedInstanceCount === "object") + message.notifiedInstanceCount = new $util.LongBits(object.notifiedInstanceCount.low >>> 0, object.notifiedInstanceCount.high >>> 0).toNumber(); + if (object.startedInstanceCount != null) + if ($util.Long) + (message.startedInstanceCount = $util.Long.fromValue(object.startedInstanceCount)).unsigned = false; + else if (typeof object.startedInstanceCount === "string") + message.startedInstanceCount = parseInt(object.startedInstanceCount, 10); + else if (typeof object.startedInstanceCount === "number") + message.startedInstanceCount = object.startedInstanceCount; + else if (typeof object.startedInstanceCount === "object") + message.startedInstanceCount = new $util.LongBits(object.startedInstanceCount.low >>> 0, object.startedInstanceCount.high >>> 0).toNumber(); + if (object.downloadingPatchesInstanceCount != null) + if ($util.Long) + (message.downloadingPatchesInstanceCount = $util.Long.fromValue(object.downloadingPatchesInstanceCount)).unsigned = false; + else if (typeof object.downloadingPatchesInstanceCount === "string") + message.downloadingPatchesInstanceCount = parseInt(object.downloadingPatchesInstanceCount, 10); + else if (typeof object.downloadingPatchesInstanceCount === "number") + message.downloadingPatchesInstanceCount = object.downloadingPatchesInstanceCount; + else if (typeof object.downloadingPatchesInstanceCount === "object") + message.downloadingPatchesInstanceCount = new $util.LongBits(object.downloadingPatchesInstanceCount.low >>> 0, object.downloadingPatchesInstanceCount.high >>> 0).toNumber(); + if (object.applyingPatchesInstanceCount != null) + if ($util.Long) + (message.applyingPatchesInstanceCount = $util.Long.fromValue(object.applyingPatchesInstanceCount)).unsigned = false; + else if (typeof object.applyingPatchesInstanceCount === "string") + message.applyingPatchesInstanceCount = parseInt(object.applyingPatchesInstanceCount, 10); + else if (typeof object.applyingPatchesInstanceCount === "number") + message.applyingPatchesInstanceCount = object.applyingPatchesInstanceCount; + else if (typeof object.applyingPatchesInstanceCount === "object") + message.applyingPatchesInstanceCount = new $util.LongBits(object.applyingPatchesInstanceCount.low >>> 0, object.applyingPatchesInstanceCount.high >>> 0).toNumber(); + if (object.rebootingInstanceCount != null) + if ($util.Long) + (message.rebootingInstanceCount = $util.Long.fromValue(object.rebootingInstanceCount)).unsigned = false; + else if (typeof object.rebootingInstanceCount === "string") + message.rebootingInstanceCount = parseInt(object.rebootingInstanceCount, 10); + else if (typeof object.rebootingInstanceCount === "number") + message.rebootingInstanceCount = object.rebootingInstanceCount; + else if (typeof object.rebootingInstanceCount === "object") + message.rebootingInstanceCount = new $util.LongBits(object.rebootingInstanceCount.low >>> 0, object.rebootingInstanceCount.high >>> 0).toNumber(); + if (object.succeededInstanceCount != null) + if ($util.Long) + (message.succeededInstanceCount = $util.Long.fromValue(object.succeededInstanceCount)).unsigned = false; + else if (typeof object.succeededInstanceCount === "string") + message.succeededInstanceCount = parseInt(object.succeededInstanceCount, 10); + else if (typeof object.succeededInstanceCount === "number") + message.succeededInstanceCount = object.succeededInstanceCount; + else if (typeof object.succeededInstanceCount === "object") + message.succeededInstanceCount = new $util.LongBits(object.succeededInstanceCount.low >>> 0, object.succeededInstanceCount.high >>> 0).toNumber(); + if (object.succeededRebootRequiredInstanceCount != null) + if ($util.Long) + (message.succeededRebootRequiredInstanceCount = $util.Long.fromValue(object.succeededRebootRequiredInstanceCount)).unsigned = false; + else if (typeof object.succeededRebootRequiredInstanceCount === "string") + message.succeededRebootRequiredInstanceCount = parseInt(object.succeededRebootRequiredInstanceCount, 10); + else if (typeof object.succeededRebootRequiredInstanceCount === "number") + message.succeededRebootRequiredInstanceCount = object.succeededRebootRequiredInstanceCount; + else if (typeof object.succeededRebootRequiredInstanceCount === "object") + message.succeededRebootRequiredInstanceCount = new $util.LongBits(object.succeededRebootRequiredInstanceCount.low >>> 0, object.succeededRebootRequiredInstanceCount.high >>> 0).toNumber(); + if (object.failedInstanceCount != null) + if ($util.Long) + (message.failedInstanceCount = $util.Long.fromValue(object.failedInstanceCount)).unsigned = false; + else if (typeof object.failedInstanceCount === "string") + message.failedInstanceCount = parseInt(object.failedInstanceCount, 10); + else if (typeof object.failedInstanceCount === "number") + message.failedInstanceCount = object.failedInstanceCount; + else if (typeof object.failedInstanceCount === "object") + message.failedInstanceCount = new $util.LongBits(object.failedInstanceCount.low >>> 0, object.failedInstanceCount.high >>> 0).toNumber(); + if (object.ackedInstanceCount != null) + if ($util.Long) + (message.ackedInstanceCount = $util.Long.fromValue(object.ackedInstanceCount)).unsigned = false; + else if (typeof object.ackedInstanceCount === "string") + message.ackedInstanceCount = parseInt(object.ackedInstanceCount, 10); + else if (typeof object.ackedInstanceCount === "number") + message.ackedInstanceCount = object.ackedInstanceCount; + else if (typeof object.ackedInstanceCount === "object") + message.ackedInstanceCount = new $util.LongBits(object.ackedInstanceCount.low >>> 0, object.ackedInstanceCount.high >>> 0).toNumber(); + if (object.timedOutInstanceCount != null) + if ($util.Long) + (message.timedOutInstanceCount = $util.Long.fromValue(object.timedOutInstanceCount)).unsigned = false; + else if (typeof object.timedOutInstanceCount === "string") + message.timedOutInstanceCount = parseInt(object.timedOutInstanceCount, 10); + else if (typeof object.timedOutInstanceCount === "number") + message.timedOutInstanceCount = object.timedOutInstanceCount; + else if (typeof object.timedOutInstanceCount === "object") + message.timedOutInstanceCount = new $util.LongBits(object.timedOutInstanceCount.low >>> 0, object.timedOutInstanceCount.high >>> 0).toNumber(); + if (object.prePatchStepInstanceCount != null) + if ($util.Long) + (message.prePatchStepInstanceCount = $util.Long.fromValue(object.prePatchStepInstanceCount)).unsigned = false; + else if (typeof object.prePatchStepInstanceCount === "string") + message.prePatchStepInstanceCount = parseInt(object.prePatchStepInstanceCount, 10); + else if (typeof object.prePatchStepInstanceCount === "number") + message.prePatchStepInstanceCount = object.prePatchStepInstanceCount; + else if (typeof object.prePatchStepInstanceCount === "object") + message.prePatchStepInstanceCount = new $util.LongBits(object.prePatchStepInstanceCount.low >>> 0, object.prePatchStepInstanceCount.high >>> 0).toNumber(); + if (object.postPatchStepInstanceCount != null) + if ($util.Long) + (message.postPatchStepInstanceCount = $util.Long.fromValue(object.postPatchStepInstanceCount)).unsigned = false; + else if (typeof object.postPatchStepInstanceCount === "string") + message.postPatchStepInstanceCount = parseInt(object.postPatchStepInstanceCount, 10); + else if (typeof object.postPatchStepInstanceCount === "number") + message.postPatchStepInstanceCount = object.postPatchStepInstanceCount; + else if (typeof object.postPatchStepInstanceCount === "object") + message.postPatchStepInstanceCount = new $util.LongBits(object.postPatchStepInstanceCount.low >>> 0, object.postPatchStepInstanceCount.high >>> 0).toNumber(); + if (object.noAgentDetectedInstanceCount != null) + if ($util.Long) + (message.noAgentDetectedInstanceCount = $util.Long.fromValue(object.noAgentDetectedInstanceCount)).unsigned = false; + else if (typeof object.noAgentDetectedInstanceCount === "string") + message.noAgentDetectedInstanceCount = parseInt(object.noAgentDetectedInstanceCount, 10); + else if (typeof object.noAgentDetectedInstanceCount === "number") + message.noAgentDetectedInstanceCount = object.noAgentDetectedInstanceCount; + else if (typeof object.noAgentDetectedInstanceCount === "object") + message.noAgentDetectedInstanceCount = new $util.LongBits(object.noAgentDetectedInstanceCount.low >>> 0, object.noAgentDetectedInstanceCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an InstanceDetailsSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @static + * @param {google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary} message InstanceDetailsSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceDetailsSummary.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.pendingInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.pendingInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.inactiveInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.inactiveInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.notifiedInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.notifiedInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startedInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startedInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.downloadingPatchesInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.downloadingPatchesInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.applyingPatchesInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.applyingPatchesInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rebootingInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rebootingInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.succeededInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.succeededInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.succeededRebootRequiredInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.succeededRebootRequiredInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.ackedInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ackedInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timedOutInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timedOutInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.prePatchStepInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.prePatchStepInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.postPatchStepInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.postPatchStepInstanceCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.noAgentDetectedInstanceCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.noAgentDetectedInstanceCount = options.longs === String ? "0" : 0; + } + if (message.pendingInstanceCount != null && message.hasOwnProperty("pendingInstanceCount")) + if (typeof message.pendingInstanceCount === "number") + object.pendingInstanceCount = options.longs === String ? String(message.pendingInstanceCount) : message.pendingInstanceCount; + else + object.pendingInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.pendingInstanceCount) : options.longs === Number ? new $util.LongBits(message.pendingInstanceCount.low >>> 0, message.pendingInstanceCount.high >>> 0).toNumber() : message.pendingInstanceCount; + if (message.inactiveInstanceCount != null && message.hasOwnProperty("inactiveInstanceCount")) + if (typeof message.inactiveInstanceCount === "number") + object.inactiveInstanceCount = options.longs === String ? String(message.inactiveInstanceCount) : message.inactiveInstanceCount; + else + object.inactiveInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.inactiveInstanceCount) : options.longs === Number ? new $util.LongBits(message.inactiveInstanceCount.low >>> 0, message.inactiveInstanceCount.high >>> 0).toNumber() : message.inactiveInstanceCount; + if (message.notifiedInstanceCount != null && message.hasOwnProperty("notifiedInstanceCount")) + if (typeof message.notifiedInstanceCount === "number") + object.notifiedInstanceCount = options.longs === String ? String(message.notifiedInstanceCount) : message.notifiedInstanceCount; + else + object.notifiedInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.notifiedInstanceCount) : options.longs === Number ? new $util.LongBits(message.notifiedInstanceCount.low >>> 0, message.notifiedInstanceCount.high >>> 0).toNumber() : message.notifiedInstanceCount; + if (message.startedInstanceCount != null && message.hasOwnProperty("startedInstanceCount")) + if (typeof message.startedInstanceCount === "number") + object.startedInstanceCount = options.longs === String ? String(message.startedInstanceCount) : message.startedInstanceCount; + else + object.startedInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.startedInstanceCount) : options.longs === Number ? new $util.LongBits(message.startedInstanceCount.low >>> 0, message.startedInstanceCount.high >>> 0).toNumber() : message.startedInstanceCount; + if (message.downloadingPatchesInstanceCount != null && message.hasOwnProperty("downloadingPatchesInstanceCount")) + if (typeof message.downloadingPatchesInstanceCount === "number") + object.downloadingPatchesInstanceCount = options.longs === String ? String(message.downloadingPatchesInstanceCount) : message.downloadingPatchesInstanceCount; + else + object.downloadingPatchesInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.downloadingPatchesInstanceCount) : options.longs === Number ? new $util.LongBits(message.downloadingPatchesInstanceCount.low >>> 0, message.downloadingPatchesInstanceCount.high >>> 0).toNumber() : message.downloadingPatchesInstanceCount; + if (message.applyingPatchesInstanceCount != null && message.hasOwnProperty("applyingPatchesInstanceCount")) + if (typeof message.applyingPatchesInstanceCount === "number") + object.applyingPatchesInstanceCount = options.longs === String ? String(message.applyingPatchesInstanceCount) : message.applyingPatchesInstanceCount; + else + object.applyingPatchesInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.applyingPatchesInstanceCount) : options.longs === Number ? new $util.LongBits(message.applyingPatchesInstanceCount.low >>> 0, message.applyingPatchesInstanceCount.high >>> 0).toNumber() : message.applyingPatchesInstanceCount; + if (message.rebootingInstanceCount != null && message.hasOwnProperty("rebootingInstanceCount")) + if (typeof message.rebootingInstanceCount === "number") + object.rebootingInstanceCount = options.longs === String ? String(message.rebootingInstanceCount) : message.rebootingInstanceCount; + else + object.rebootingInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.rebootingInstanceCount) : options.longs === Number ? new $util.LongBits(message.rebootingInstanceCount.low >>> 0, message.rebootingInstanceCount.high >>> 0).toNumber() : message.rebootingInstanceCount; + if (message.succeededInstanceCount != null && message.hasOwnProperty("succeededInstanceCount")) + if (typeof message.succeededInstanceCount === "number") + object.succeededInstanceCount = options.longs === String ? String(message.succeededInstanceCount) : message.succeededInstanceCount; + else + object.succeededInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.succeededInstanceCount) : options.longs === Number ? new $util.LongBits(message.succeededInstanceCount.low >>> 0, message.succeededInstanceCount.high >>> 0).toNumber() : message.succeededInstanceCount; + if (message.succeededRebootRequiredInstanceCount != null && message.hasOwnProperty("succeededRebootRequiredInstanceCount")) + if (typeof message.succeededRebootRequiredInstanceCount === "number") + object.succeededRebootRequiredInstanceCount = options.longs === String ? String(message.succeededRebootRequiredInstanceCount) : message.succeededRebootRequiredInstanceCount; + else + object.succeededRebootRequiredInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.succeededRebootRequiredInstanceCount) : options.longs === Number ? new $util.LongBits(message.succeededRebootRequiredInstanceCount.low >>> 0, message.succeededRebootRequiredInstanceCount.high >>> 0).toNumber() : message.succeededRebootRequiredInstanceCount; + if (message.failedInstanceCount != null && message.hasOwnProperty("failedInstanceCount")) + if (typeof message.failedInstanceCount === "number") + object.failedInstanceCount = options.longs === String ? String(message.failedInstanceCount) : message.failedInstanceCount; + else + object.failedInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.failedInstanceCount) : options.longs === Number ? new $util.LongBits(message.failedInstanceCount.low >>> 0, message.failedInstanceCount.high >>> 0).toNumber() : message.failedInstanceCount; + if (message.ackedInstanceCount != null && message.hasOwnProperty("ackedInstanceCount")) + if (typeof message.ackedInstanceCount === "number") + object.ackedInstanceCount = options.longs === String ? String(message.ackedInstanceCount) : message.ackedInstanceCount; + else + object.ackedInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.ackedInstanceCount) : options.longs === Number ? new $util.LongBits(message.ackedInstanceCount.low >>> 0, message.ackedInstanceCount.high >>> 0).toNumber() : message.ackedInstanceCount; + if (message.timedOutInstanceCount != null && message.hasOwnProperty("timedOutInstanceCount")) + if (typeof message.timedOutInstanceCount === "number") + object.timedOutInstanceCount = options.longs === String ? String(message.timedOutInstanceCount) : message.timedOutInstanceCount; + else + object.timedOutInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.timedOutInstanceCount) : options.longs === Number ? new $util.LongBits(message.timedOutInstanceCount.low >>> 0, message.timedOutInstanceCount.high >>> 0).toNumber() : message.timedOutInstanceCount; + if (message.prePatchStepInstanceCount != null && message.hasOwnProperty("prePatchStepInstanceCount")) + if (typeof message.prePatchStepInstanceCount === "number") + object.prePatchStepInstanceCount = options.longs === String ? String(message.prePatchStepInstanceCount) : message.prePatchStepInstanceCount; + else + object.prePatchStepInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.prePatchStepInstanceCount) : options.longs === Number ? new $util.LongBits(message.prePatchStepInstanceCount.low >>> 0, message.prePatchStepInstanceCount.high >>> 0).toNumber() : message.prePatchStepInstanceCount; + if (message.postPatchStepInstanceCount != null && message.hasOwnProperty("postPatchStepInstanceCount")) + if (typeof message.postPatchStepInstanceCount === "number") + object.postPatchStepInstanceCount = options.longs === String ? String(message.postPatchStepInstanceCount) : message.postPatchStepInstanceCount; + else + object.postPatchStepInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.postPatchStepInstanceCount) : options.longs === Number ? new $util.LongBits(message.postPatchStepInstanceCount.low >>> 0, message.postPatchStepInstanceCount.high >>> 0).toNumber() : message.postPatchStepInstanceCount; + if (message.noAgentDetectedInstanceCount != null && message.hasOwnProperty("noAgentDetectedInstanceCount")) + if (typeof message.noAgentDetectedInstanceCount === "number") + object.noAgentDetectedInstanceCount = options.longs === String ? String(message.noAgentDetectedInstanceCount) : message.noAgentDetectedInstanceCount; + else + object.noAgentDetectedInstanceCount = options.longs === String ? $util.Long.prototype.toString.call(message.noAgentDetectedInstanceCount) : options.longs === Number ? new $util.LongBits(message.noAgentDetectedInstanceCount.low >>> 0, message.noAgentDetectedInstanceCount.high >>> 0).toNumber() : message.noAgentDetectedInstanceCount; + return object; + }; + + /** + * Converts this InstanceDetailsSummary to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @instance + * @returns {Object.} JSON object + */ + InstanceDetailsSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceDetailsSummary + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceDetailsSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.PatchJob.InstanceDetailsSummary"; + }; + + return InstanceDetailsSummary; + })(); + + return PatchJob; + })(); + + v1.PatchConfig = (function() { + + /** + * Properties of a PatchConfig. + * @memberof google.cloud.osconfig.v1 + * @interface IPatchConfig + * @property {google.cloud.osconfig.v1.PatchConfig.RebootConfig|null} [rebootConfig] PatchConfig rebootConfig + * @property {google.cloud.osconfig.v1.IAptSettings|null} [apt] PatchConfig apt + * @property {google.cloud.osconfig.v1.IYumSettings|null} [yum] PatchConfig yum + * @property {google.cloud.osconfig.v1.IGooSettings|null} [goo] PatchConfig goo + * @property {google.cloud.osconfig.v1.IZypperSettings|null} [zypper] PatchConfig zypper + * @property {google.cloud.osconfig.v1.IWindowsUpdateSettings|null} [windowsUpdate] PatchConfig windowsUpdate + * @property {google.cloud.osconfig.v1.IExecStep|null} [preStep] PatchConfig preStep + * @property {google.cloud.osconfig.v1.IExecStep|null} [postStep] PatchConfig postStep + * @property {boolean|null} [migInstancesAllowed] PatchConfig migInstancesAllowed + */ + + /** + * Constructs a new PatchConfig. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a PatchConfig. + * @implements IPatchConfig + * @constructor + * @param {google.cloud.osconfig.v1.IPatchConfig=} [properties] Properties to set + */ + function PatchConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchConfig rebootConfig. + * @member {google.cloud.osconfig.v1.PatchConfig.RebootConfig} rebootConfig + * @memberof google.cloud.osconfig.v1.PatchConfig + * @instance + */ + PatchConfig.prototype.rebootConfig = 0; + + /** + * PatchConfig apt. + * @member {google.cloud.osconfig.v1.IAptSettings|null|undefined} apt + * @memberof google.cloud.osconfig.v1.PatchConfig + * @instance + */ + PatchConfig.prototype.apt = null; + + /** + * PatchConfig yum. + * @member {google.cloud.osconfig.v1.IYumSettings|null|undefined} yum + * @memberof google.cloud.osconfig.v1.PatchConfig + * @instance + */ + PatchConfig.prototype.yum = null; + + /** + * PatchConfig goo. + * @member {google.cloud.osconfig.v1.IGooSettings|null|undefined} goo + * @memberof google.cloud.osconfig.v1.PatchConfig + * @instance + */ + PatchConfig.prototype.goo = null; + + /** + * PatchConfig zypper. + * @member {google.cloud.osconfig.v1.IZypperSettings|null|undefined} zypper + * @memberof google.cloud.osconfig.v1.PatchConfig + * @instance + */ + PatchConfig.prototype.zypper = null; + + /** + * PatchConfig windowsUpdate. + * @member {google.cloud.osconfig.v1.IWindowsUpdateSettings|null|undefined} windowsUpdate + * @memberof google.cloud.osconfig.v1.PatchConfig + * @instance + */ + PatchConfig.prototype.windowsUpdate = null; + + /** + * PatchConfig preStep. + * @member {google.cloud.osconfig.v1.IExecStep|null|undefined} preStep + * @memberof google.cloud.osconfig.v1.PatchConfig + * @instance + */ + PatchConfig.prototype.preStep = null; + + /** + * PatchConfig postStep. + * @member {google.cloud.osconfig.v1.IExecStep|null|undefined} postStep + * @memberof google.cloud.osconfig.v1.PatchConfig + * @instance + */ + PatchConfig.prototype.postStep = null; + + /** + * PatchConfig migInstancesAllowed. + * @member {boolean} migInstancesAllowed + * @memberof google.cloud.osconfig.v1.PatchConfig + * @instance + */ + PatchConfig.prototype.migInstancesAllowed = false; + + /** + * Creates a new PatchConfig instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.PatchConfig + * @static + * @param {google.cloud.osconfig.v1.IPatchConfig=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.PatchConfig} PatchConfig instance + */ + PatchConfig.create = function create(properties) { + return new PatchConfig(properties); + }; + + /** + * Encodes the specified PatchConfig message. Does not implicitly {@link google.cloud.osconfig.v1.PatchConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.PatchConfig + * @static + * @param {google.cloud.osconfig.v1.IPatchConfig} message PatchConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rebootConfig != null && Object.hasOwnProperty.call(message, "rebootConfig")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rebootConfig); + if (message.apt != null && Object.hasOwnProperty.call(message, "apt")) + $root.google.cloud.osconfig.v1.AptSettings.encode(message.apt, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.yum != null && Object.hasOwnProperty.call(message, "yum")) + $root.google.cloud.osconfig.v1.YumSettings.encode(message.yum, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.goo != null && Object.hasOwnProperty.call(message, "goo")) + $root.google.cloud.osconfig.v1.GooSettings.encode(message.goo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.zypper != null && Object.hasOwnProperty.call(message, "zypper")) + $root.google.cloud.osconfig.v1.ZypperSettings.encode(message.zypper, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.windowsUpdate != null && Object.hasOwnProperty.call(message, "windowsUpdate")) + $root.google.cloud.osconfig.v1.WindowsUpdateSettings.encode(message.windowsUpdate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.preStep != null && Object.hasOwnProperty.call(message, "preStep")) + $root.google.cloud.osconfig.v1.ExecStep.encode(message.preStep, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.postStep != null && Object.hasOwnProperty.call(message, "postStep")) + $root.google.cloud.osconfig.v1.ExecStep.encode(message.postStep, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.migInstancesAllowed != null && Object.hasOwnProperty.call(message, "migInstancesAllowed")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.migInstancesAllowed); + return writer; + }; + + /** + * Encodes the specified PatchConfig message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.PatchConfig + * @static + * @param {google.cloud.osconfig.v1.IPatchConfig} message PatchConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.PatchConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.PatchConfig} PatchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.PatchConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rebootConfig = reader.int32(); + break; + } + case 3: { + message.apt = $root.google.cloud.osconfig.v1.AptSettings.decode(reader, reader.uint32()); + break; + } + case 4: { + message.yum = $root.google.cloud.osconfig.v1.YumSettings.decode(reader, reader.uint32()); + break; + } + case 5: { + message.goo = $root.google.cloud.osconfig.v1.GooSettings.decode(reader, reader.uint32()); + break; + } + case 6: { + message.zypper = $root.google.cloud.osconfig.v1.ZypperSettings.decode(reader, reader.uint32()); + break; + } + case 7: { + message.windowsUpdate = $root.google.cloud.osconfig.v1.WindowsUpdateSettings.decode(reader, reader.uint32()); + break; + } + case 8: { + message.preStep = $root.google.cloud.osconfig.v1.ExecStep.decode(reader, reader.uint32()); + break; + } + case 9: { + message.postStep = $root.google.cloud.osconfig.v1.ExecStep.decode(reader, reader.uint32()); + break; + } + case 10: { + message.migInstancesAllowed = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.PatchConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.PatchConfig} PatchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchConfig message. + * @function verify + * @memberof google.cloud.osconfig.v1.PatchConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rebootConfig != null && message.hasOwnProperty("rebootConfig")) + switch (message.rebootConfig) { + default: + return "rebootConfig: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.apt != null && message.hasOwnProperty("apt")) { + var error = $root.google.cloud.osconfig.v1.AptSettings.verify(message.apt); + if (error) + return "apt." + error; + } + if (message.yum != null && message.hasOwnProperty("yum")) { + var error = $root.google.cloud.osconfig.v1.YumSettings.verify(message.yum); + if (error) + return "yum." + error; + } + if (message.goo != null && message.hasOwnProperty("goo")) { + var error = $root.google.cloud.osconfig.v1.GooSettings.verify(message.goo); + if (error) + return "goo." + error; + } + if (message.zypper != null && message.hasOwnProperty("zypper")) { + var error = $root.google.cloud.osconfig.v1.ZypperSettings.verify(message.zypper); + if (error) + return "zypper." + error; + } + if (message.windowsUpdate != null && message.hasOwnProperty("windowsUpdate")) { + var error = $root.google.cloud.osconfig.v1.WindowsUpdateSettings.verify(message.windowsUpdate); + if (error) + return "windowsUpdate." + error; + } + if (message.preStep != null && message.hasOwnProperty("preStep")) { + var error = $root.google.cloud.osconfig.v1.ExecStep.verify(message.preStep); + if (error) + return "preStep." + error; + } + if (message.postStep != null && message.hasOwnProperty("postStep")) { + var error = $root.google.cloud.osconfig.v1.ExecStep.verify(message.postStep); + if (error) + return "postStep." + error; + } + if (message.migInstancesAllowed != null && message.hasOwnProperty("migInstancesAllowed")) + if (typeof message.migInstancesAllowed !== "boolean") + return "migInstancesAllowed: boolean expected"; + return null; + }; + + /** + * Creates a PatchConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.PatchConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.PatchConfig} PatchConfig + */ + PatchConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.PatchConfig) + return object; + var message = new $root.google.cloud.osconfig.v1.PatchConfig(); + switch (object.rebootConfig) { + default: + if (typeof object.rebootConfig === "number") { + message.rebootConfig = object.rebootConfig; + break; + } + break; + case "REBOOT_CONFIG_UNSPECIFIED": + case 0: + message.rebootConfig = 0; + break; + case "DEFAULT": + case 1: + message.rebootConfig = 1; + break; + case "ALWAYS": + case 2: + message.rebootConfig = 2; + break; + case "NEVER": + case 3: + message.rebootConfig = 3; + break; + } + if (object.apt != null) { + if (typeof object.apt !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchConfig.apt: object expected"); + message.apt = $root.google.cloud.osconfig.v1.AptSettings.fromObject(object.apt); + } + if (object.yum != null) { + if (typeof object.yum !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchConfig.yum: object expected"); + message.yum = $root.google.cloud.osconfig.v1.YumSettings.fromObject(object.yum); + } + if (object.goo != null) { + if (typeof object.goo !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchConfig.goo: object expected"); + message.goo = $root.google.cloud.osconfig.v1.GooSettings.fromObject(object.goo); + } + if (object.zypper != null) { + if (typeof object.zypper !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchConfig.zypper: object expected"); + message.zypper = $root.google.cloud.osconfig.v1.ZypperSettings.fromObject(object.zypper); + } + if (object.windowsUpdate != null) { + if (typeof object.windowsUpdate !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchConfig.windowsUpdate: object expected"); + message.windowsUpdate = $root.google.cloud.osconfig.v1.WindowsUpdateSettings.fromObject(object.windowsUpdate); + } + if (object.preStep != null) { + if (typeof object.preStep !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchConfig.preStep: object expected"); + message.preStep = $root.google.cloud.osconfig.v1.ExecStep.fromObject(object.preStep); + } + if (object.postStep != null) { + if (typeof object.postStep !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchConfig.postStep: object expected"); + message.postStep = $root.google.cloud.osconfig.v1.ExecStep.fromObject(object.postStep); + } + if (object.migInstancesAllowed != null) + message.migInstancesAllowed = Boolean(object.migInstancesAllowed); + return message; + }; + + /** + * Creates a plain object from a PatchConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.PatchConfig + * @static + * @param {google.cloud.osconfig.v1.PatchConfig} message PatchConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rebootConfig = options.enums === String ? "REBOOT_CONFIG_UNSPECIFIED" : 0; + object.apt = null; + object.yum = null; + object.goo = null; + object.zypper = null; + object.windowsUpdate = null; + object.preStep = null; + object.postStep = null; + object.migInstancesAllowed = false; + } + if (message.rebootConfig != null && message.hasOwnProperty("rebootConfig")) + object.rebootConfig = options.enums === String ? $root.google.cloud.osconfig.v1.PatchConfig.RebootConfig[message.rebootConfig] === undefined ? message.rebootConfig : $root.google.cloud.osconfig.v1.PatchConfig.RebootConfig[message.rebootConfig] : message.rebootConfig; + if (message.apt != null && message.hasOwnProperty("apt")) + object.apt = $root.google.cloud.osconfig.v1.AptSettings.toObject(message.apt, options); + if (message.yum != null && message.hasOwnProperty("yum")) + object.yum = $root.google.cloud.osconfig.v1.YumSettings.toObject(message.yum, options); + if (message.goo != null && message.hasOwnProperty("goo")) + object.goo = $root.google.cloud.osconfig.v1.GooSettings.toObject(message.goo, options); + if (message.zypper != null && message.hasOwnProperty("zypper")) + object.zypper = $root.google.cloud.osconfig.v1.ZypperSettings.toObject(message.zypper, options); + if (message.windowsUpdate != null && message.hasOwnProperty("windowsUpdate")) + object.windowsUpdate = $root.google.cloud.osconfig.v1.WindowsUpdateSettings.toObject(message.windowsUpdate, options); + if (message.preStep != null && message.hasOwnProperty("preStep")) + object.preStep = $root.google.cloud.osconfig.v1.ExecStep.toObject(message.preStep, options); + if (message.postStep != null && message.hasOwnProperty("postStep")) + object.postStep = $root.google.cloud.osconfig.v1.ExecStep.toObject(message.postStep, options); + if (message.migInstancesAllowed != null && message.hasOwnProperty("migInstancesAllowed")) + object.migInstancesAllowed = message.migInstancesAllowed; + return object; + }; + + /** + * Converts this PatchConfig to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.PatchConfig + * @instance + * @returns {Object.} JSON object + */ + PatchConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PatchConfig + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.PatchConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PatchConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.PatchConfig"; + }; + + /** + * RebootConfig enum. + * @name google.cloud.osconfig.v1.PatchConfig.RebootConfig + * @enum {number} + * @property {number} REBOOT_CONFIG_UNSPECIFIED=0 REBOOT_CONFIG_UNSPECIFIED value + * @property {number} DEFAULT=1 DEFAULT value + * @property {number} ALWAYS=2 ALWAYS value + * @property {number} NEVER=3 NEVER value + */ + PatchConfig.RebootConfig = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REBOOT_CONFIG_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT"] = 1; + values[valuesById[2] = "ALWAYS"] = 2; + values[valuesById[3] = "NEVER"] = 3; + return values; + })(); + + return PatchConfig; + })(); + + v1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.osconfig.v1 + * @interface IInstance + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.osconfig.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Instance + * @static + * @param {google.cloud.osconfig.v1.IInstance=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.osconfig.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Instance + * @static + * @param {google.cloud.osconfig.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Instance + * @static + * @param {google.cloud.osconfig.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Instance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.osconfig.v1.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Instance) + return object; + return new $root.google.cloud.osconfig.v1.Instance(); + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Instance + * @static + * @param {google.cloud.osconfig.v1.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Instance"; + }; + + /** + * PatchState enum. + * @name google.cloud.osconfig.v1.Instance.PatchState + * @enum {number} + * @property {number} PATCH_STATE_UNSPECIFIED=0 PATCH_STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} INACTIVE=2 INACTIVE value + * @property {number} NOTIFIED=3 NOTIFIED value + * @property {number} STARTED=4 STARTED value + * @property {number} DOWNLOADING_PATCHES=5 DOWNLOADING_PATCHES value + * @property {number} APPLYING_PATCHES=6 APPLYING_PATCHES value + * @property {number} REBOOTING=7 REBOOTING value + * @property {number} SUCCEEDED=8 SUCCEEDED value + * @property {number} SUCCEEDED_REBOOT_REQUIRED=9 SUCCEEDED_REBOOT_REQUIRED value + * @property {number} FAILED=10 FAILED value + * @property {number} ACKED=11 ACKED value + * @property {number} TIMED_OUT=12 TIMED_OUT value + * @property {number} RUNNING_PRE_PATCH_STEP=13 RUNNING_PRE_PATCH_STEP value + * @property {number} RUNNING_POST_PATCH_STEP=14 RUNNING_POST_PATCH_STEP value + * @property {number} NO_AGENT_DETECTED=15 NO_AGENT_DETECTED value + */ + Instance.PatchState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PATCH_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + values[valuesById[3] = "NOTIFIED"] = 3; + values[valuesById[4] = "STARTED"] = 4; + values[valuesById[5] = "DOWNLOADING_PATCHES"] = 5; + values[valuesById[6] = "APPLYING_PATCHES"] = 6; + values[valuesById[7] = "REBOOTING"] = 7; + values[valuesById[8] = "SUCCEEDED"] = 8; + values[valuesById[9] = "SUCCEEDED_REBOOT_REQUIRED"] = 9; + values[valuesById[10] = "FAILED"] = 10; + values[valuesById[11] = "ACKED"] = 11; + values[valuesById[12] = "TIMED_OUT"] = 12; + values[valuesById[13] = "RUNNING_PRE_PATCH_STEP"] = 13; + values[valuesById[14] = "RUNNING_POST_PATCH_STEP"] = 14; + values[valuesById[15] = "NO_AGENT_DETECTED"] = 15; + return values; + })(); + + return Instance; + })(); + + v1.CancelPatchJobRequest = (function() { + + /** + * Properties of a CancelPatchJobRequest. + * @memberof google.cloud.osconfig.v1 + * @interface ICancelPatchJobRequest + * @property {string|null} [name] CancelPatchJobRequest name + */ + + /** + * Constructs a new CancelPatchJobRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a CancelPatchJobRequest. + * @implements ICancelPatchJobRequest + * @constructor + * @param {google.cloud.osconfig.v1.ICancelPatchJobRequest=} [properties] Properties to set + */ + function CancelPatchJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelPatchJobRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.CancelPatchJobRequest + * @instance + */ + CancelPatchJobRequest.prototype.name = ""; + + /** + * Creates a new CancelPatchJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.CancelPatchJobRequest + * @static + * @param {google.cloud.osconfig.v1.ICancelPatchJobRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.CancelPatchJobRequest} CancelPatchJobRequest instance + */ + CancelPatchJobRequest.create = function create(properties) { + return new CancelPatchJobRequest(properties); + }; + + /** + * Encodes the specified CancelPatchJobRequest message. Does not implicitly {@link google.cloud.osconfig.v1.CancelPatchJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.CancelPatchJobRequest + * @static + * @param {google.cloud.osconfig.v1.ICancelPatchJobRequest} message CancelPatchJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelPatchJobRequest.encode = function encode(message, writer) { + 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 CancelPatchJobRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.CancelPatchJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.CancelPatchJobRequest + * @static + * @param {google.cloud.osconfig.v1.ICancelPatchJobRequest} message CancelPatchJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelPatchJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelPatchJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.CancelPatchJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.CancelPatchJobRequest} CancelPatchJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelPatchJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.CancelPatchJobRequest(); + 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 CancelPatchJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.CancelPatchJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.CancelPatchJobRequest} CancelPatchJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelPatchJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelPatchJobRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.CancelPatchJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelPatchJobRequest.verify = function verify(message) { + if (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 CancelPatchJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.CancelPatchJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.CancelPatchJobRequest} CancelPatchJobRequest + */ + CancelPatchJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.CancelPatchJobRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.CancelPatchJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelPatchJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.CancelPatchJobRequest + * @static + * @param {google.cloud.osconfig.v1.CancelPatchJobRequest} message CancelPatchJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelPatchJobRequest.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 CancelPatchJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.CancelPatchJobRequest + * @instance + * @returns {Object.} JSON object + */ + CancelPatchJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelPatchJobRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.CancelPatchJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelPatchJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.CancelPatchJobRequest"; + }; + + return CancelPatchJobRequest; + })(); + + v1.AptSettings = (function() { + + /** + * Properties of an AptSettings. + * @memberof google.cloud.osconfig.v1 + * @interface IAptSettings + * @property {google.cloud.osconfig.v1.AptSettings.Type|null} [type] AptSettings type + * @property {Array.|null} [excludes] AptSettings excludes + * @property {Array.|null} [exclusivePackages] AptSettings exclusivePackages + */ + + /** + * Constructs a new AptSettings. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an AptSettings. + * @implements IAptSettings + * @constructor + * @param {google.cloud.osconfig.v1.IAptSettings=} [properties] Properties to set + */ + function AptSettings(properties) { + this.excludes = []; + this.exclusivePackages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AptSettings type. + * @member {google.cloud.osconfig.v1.AptSettings.Type} type + * @memberof google.cloud.osconfig.v1.AptSettings + * @instance + */ + AptSettings.prototype.type = 0; + + /** + * AptSettings excludes. + * @member {Array.} excludes + * @memberof google.cloud.osconfig.v1.AptSettings + * @instance + */ + AptSettings.prototype.excludes = $util.emptyArray; + + /** + * AptSettings exclusivePackages. + * @member {Array.} exclusivePackages + * @memberof google.cloud.osconfig.v1.AptSettings + * @instance + */ + AptSettings.prototype.exclusivePackages = $util.emptyArray; + + /** + * Creates a new AptSettings instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.AptSettings + * @static + * @param {google.cloud.osconfig.v1.IAptSettings=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.AptSettings} AptSettings instance + */ + AptSettings.create = function create(properties) { + return new AptSettings(properties); + }; + + /** + * Encodes the specified AptSettings message. Does not implicitly {@link google.cloud.osconfig.v1.AptSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.AptSettings + * @static + * @param {google.cloud.osconfig.v1.IAptSettings} message AptSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AptSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.excludes != null && message.excludes.length) + for (var i = 0; i < message.excludes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.excludes[i]); + if (message.exclusivePackages != null && message.exclusivePackages.length) + for (var i = 0; i < message.exclusivePackages.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exclusivePackages[i]); + return writer; + }; + + /** + * Encodes the specified AptSettings message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.AptSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.AptSettings + * @static + * @param {google.cloud.osconfig.v1.IAptSettings} message AptSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AptSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AptSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.AptSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.AptSettings} AptSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AptSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.AptSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + if (!(message.excludes && message.excludes.length)) + message.excludes = []; + message.excludes.push(reader.string()); + break; + } + case 3: { + if (!(message.exclusivePackages && message.exclusivePackages.length)) + message.exclusivePackages = []; + message.exclusivePackages.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AptSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.AptSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.AptSettings} AptSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AptSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AptSettings message. + * @function verify + * @memberof google.cloud.osconfig.v1.AptSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AptSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.excludes != null && message.hasOwnProperty("excludes")) { + if (!Array.isArray(message.excludes)) + return "excludes: array expected"; + for (var i = 0; i < message.excludes.length; ++i) + if (!$util.isString(message.excludes[i])) + return "excludes: string[] expected"; + } + if (message.exclusivePackages != null && message.hasOwnProperty("exclusivePackages")) { + if (!Array.isArray(message.exclusivePackages)) + return "exclusivePackages: array expected"; + for (var i = 0; i < message.exclusivePackages.length; ++i) + if (!$util.isString(message.exclusivePackages[i])) + return "exclusivePackages: string[] expected"; + } + return null; + }; + + /** + * Creates an AptSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.AptSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.AptSettings} AptSettings + */ + AptSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.AptSettings) + return object; + var message = new $root.google.cloud.osconfig.v1.AptSettings(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "DIST": + case 1: + message.type = 1; + break; + case "UPGRADE": + case 2: + message.type = 2; + break; + } + if (object.excludes) { + if (!Array.isArray(object.excludes)) + throw TypeError(".google.cloud.osconfig.v1.AptSettings.excludes: array expected"); + message.excludes = []; + for (var i = 0; i < object.excludes.length; ++i) + message.excludes[i] = String(object.excludes[i]); + } + if (object.exclusivePackages) { + if (!Array.isArray(object.exclusivePackages)) + throw TypeError(".google.cloud.osconfig.v1.AptSettings.exclusivePackages: array expected"); + message.exclusivePackages = []; + for (var i = 0; i < object.exclusivePackages.length; ++i) + message.exclusivePackages[i] = String(object.exclusivePackages[i]); + } + return message; + }; + + /** + * Creates a plain object from an AptSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.AptSettings + * @static + * @param {google.cloud.osconfig.v1.AptSettings} message AptSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AptSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.excludes = []; + object.exclusivePackages = []; + } + if (options.defaults) + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.osconfig.v1.AptSettings.Type[message.type] === undefined ? message.type : $root.google.cloud.osconfig.v1.AptSettings.Type[message.type] : message.type; + if (message.excludes && message.excludes.length) { + object.excludes = []; + for (var j = 0; j < message.excludes.length; ++j) + object.excludes[j] = message.excludes[j]; + } + if (message.exclusivePackages && message.exclusivePackages.length) { + object.exclusivePackages = []; + for (var j = 0; j < message.exclusivePackages.length; ++j) + object.exclusivePackages[j] = message.exclusivePackages[j]; + } + return object; + }; + + /** + * Converts this AptSettings to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.AptSettings + * @instance + * @returns {Object.} JSON object + */ + AptSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AptSettings + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.AptSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AptSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.AptSettings"; + }; + + /** + * Type enum. + * @name google.cloud.osconfig.v1.AptSettings.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} DIST=1 DIST value + * @property {number} UPGRADE=2 UPGRADE value + */ + AptSettings.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DIST"] = 1; + values[valuesById[2] = "UPGRADE"] = 2; + return values; + })(); + + return AptSettings; + })(); + + v1.YumSettings = (function() { + + /** + * Properties of a YumSettings. + * @memberof google.cloud.osconfig.v1 + * @interface IYumSettings + * @property {boolean|null} [security] YumSettings security + * @property {boolean|null} [minimal] YumSettings minimal + * @property {Array.|null} [excludes] YumSettings excludes + * @property {Array.|null} [exclusivePackages] YumSettings exclusivePackages + */ + + /** + * Constructs a new YumSettings. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a YumSettings. + * @implements IYumSettings + * @constructor + * @param {google.cloud.osconfig.v1.IYumSettings=} [properties] Properties to set + */ + function YumSettings(properties) { + this.excludes = []; + this.exclusivePackages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * YumSettings security. + * @member {boolean} security + * @memberof google.cloud.osconfig.v1.YumSettings + * @instance + */ + YumSettings.prototype.security = false; + + /** + * YumSettings minimal. + * @member {boolean} minimal + * @memberof google.cloud.osconfig.v1.YumSettings + * @instance + */ + YumSettings.prototype.minimal = false; + + /** + * YumSettings excludes. + * @member {Array.} excludes + * @memberof google.cloud.osconfig.v1.YumSettings + * @instance + */ + YumSettings.prototype.excludes = $util.emptyArray; + + /** + * YumSettings exclusivePackages. + * @member {Array.} exclusivePackages + * @memberof google.cloud.osconfig.v1.YumSettings + * @instance + */ + YumSettings.prototype.exclusivePackages = $util.emptyArray; + + /** + * Creates a new YumSettings instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.YumSettings + * @static + * @param {google.cloud.osconfig.v1.IYumSettings=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.YumSettings} YumSettings instance + */ + YumSettings.create = function create(properties) { + return new YumSettings(properties); + }; + + /** + * Encodes the specified YumSettings message. Does not implicitly {@link google.cloud.osconfig.v1.YumSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.YumSettings + * @static + * @param {google.cloud.osconfig.v1.IYumSettings} message YumSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YumSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.security != null && Object.hasOwnProperty.call(message, "security")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.security); + if (message.minimal != null && Object.hasOwnProperty.call(message, "minimal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.minimal); + if (message.excludes != null && message.excludes.length) + for (var i = 0; i < message.excludes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludes[i]); + if (message.exclusivePackages != null && message.exclusivePackages.length) + for (var i = 0; i < message.exclusivePackages.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.exclusivePackages[i]); + return writer; + }; + + /** + * Encodes the specified YumSettings message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.YumSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.YumSettings + * @static + * @param {google.cloud.osconfig.v1.IYumSettings} message YumSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YumSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a YumSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.YumSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.YumSettings} YumSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YumSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.YumSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.security = reader.bool(); + break; + } + case 2: { + message.minimal = reader.bool(); + break; + } + case 3: { + if (!(message.excludes && message.excludes.length)) + message.excludes = []; + message.excludes.push(reader.string()); + break; + } + case 4: { + if (!(message.exclusivePackages && message.exclusivePackages.length)) + message.exclusivePackages = []; + message.exclusivePackages.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a YumSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.YumSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.YumSettings} YumSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YumSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a YumSettings message. + * @function verify + * @memberof google.cloud.osconfig.v1.YumSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + YumSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.security != null && message.hasOwnProperty("security")) + if (typeof message.security !== "boolean") + return "security: boolean expected"; + if (message.minimal != null && message.hasOwnProperty("minimal")) + if (typeof message.minimal !== "boolean") + return "minimal: boolean expected"; + if (message.excludes != null && message.hasOwnProperty("excludes")) { + if (!Array.isArray(message.excludes)) + return "excludes: array expected"; + for (var i = 0; i < message.excludes.length; ++i) + if (!$util.isString(message.excludes[i])) + return "excludes: string[] expected"; + } + if (message.exclusivePackages != null && message.hasOwnProperty("exclusivePackages")) { + if (!Array.isArray(message.exclusivePackages)) + return "exclusivePackages: array expected"; + for (var i = 0; i < message.exclusivePackages.length; ++i) + if (!$util.isString(message.exclusivePackages[i])) + return "exclusivePackages: string[] expected"; + } + return null; + }; + + /** + * Creates a YumSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.YumSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.YumSettings} YumSettings + */ + YumSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.YumSettings) + return object; + var message = new $root.google.cloud.osconfig.v1.YumSettings(); + if (object.security != null) + message.security = Boolean(object.security); + if (object.minimal != null) + message.minimal = Boolean(object.minimal); + if (object.excludes) { + if (!Array.isArray(object.excludes)) + throw TypeError(".google.cloud.osconfig.v1.YumSettings.excludes: array expected"); + message.excludes = []; + for (var i = 0; i < object.excludes.length; ++i) + message.excludes[i] = String(object.excludes[i]); + } + if (object.exclusivePackages) { + if (!Array.isArray(object.exclusivePackages)) + throw TypeError(".google.cloud.osconfig.v1.YumSettings.exclusivePackages: array expected"); + message.exclusivePackages = []; + for (var i = 0; i < object.exclusivePackages.length; ++i) + message.exclusivePackages[i] = String(object.exclusivePackages[i]); + } + return message; + }; + + /** + * Creates a plain object from a YumSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.YumSettings + * @static + * @param {google.cloud.osconfig.v1.YumSettings} message YumSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + YumSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.excludes = []; + object.exclusivePackages = []; + } + if (options.defaults) { + object.security = false; + object.minimal = false; + } + if (message.security != null && message.hasOwnProperty("security")) + object.security = message.security; + if (message.minimal != null && message.hasOwnProperty("minimal")) + object.minimal = message.minimal; + if (message.excludes && message.excludes.length) { + object.excludes = []; + for (var j = 0; j < message.excludes.length; ++j) + object.excludes[j] = message.excludes[j]; + } + if (message.exclusivePackages && message.exclusivePackages.length) { + object.exclusivePackages = []; + for (var j = 0; j < message.exclusivePackages.length; ++j) + object.exclusivePackages[j] = message.exclusivePackages[j]; + } + return object; + }; + + /** + * Converts this YumSettings to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.YumSettings + * @instance + * @returns {Object.} JSON object + */ + YumSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for YumSettings + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.YumSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + YumSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.YumSettings"; + }; + + return YumSettings; + })(); + + v1.GooSettings = (function() { + + /** + * Properties of a GooSettings. + * @memberof google.cloud.osconfig.v1 + * @interface IGooSettings + */ + + /** + * Constructs a new GooSettings. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a GooSettings. + * @implements IGooSettings + * @constructor + * @param {google.cloud.osconfig.v1.IGooSettings=} [properties] Properties to set + */ + function GooSettings(properties) { + if (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 GooSettings instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.GooSettings + * @static + * @param {google.cloud.osconfig.v1.IGooSettings=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.GooSettings} GooSettings instance + */ + GooSettings.create = function create(properties) { + return new GooSettings(properties); + }; + + /** + * Encodes the specified GooSettings message. Does not implicitly {@link google.cloud.osconfig.v1.GooSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.GooSettings + * @static + * @param {google.cloud.osconfig.v1.IGooSettings} message GooSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GooSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GooSettings message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GooSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.GooSettings + * @static + * @param {google.cloud.osconfig.v1.IGooSettings} message GooSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GooSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GooSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.GooSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.GooSettings} GooSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GooSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.GooSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GooSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.GooSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.GooSettings} GooSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GooSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GooSettings message. + * @function verify + * @memberof google.cloud.osconfig.v1.GooSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GooSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GooSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.GooSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.GooSettings} GooSettings + */ + GooSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.GooSettings) + return object; + return new $root.google.cloud.osconfig.v1.GooSettings(); + }; + + /** + * Creates a plain object from a GooSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.GooSettings + * @static + * @param {google.cloud.osconfig.v1.GooSettings} message GooSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GooSettings.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GooSettings to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.GooSettings + * @instance + * @returns {Object.} JSON object + */ + GooSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GooSettings + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.GooSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GooSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.GooSettings"; + }; + + return GooSettings; + })(); + + v1.ZypperSettings = (function() { + + /** + * Properties of a ZypperSettings. + * @memberof google.cloud.osconfig.v1 + * @interface IZypperSettings + * @property {boolean|null} [withOptional] ZypperSettings withOptional + * @property {boolean|null} [withUpdate] ZypperSettings withUpdate + * @property {Array.|null} [categories] ZypperSettings categories + * @property {Array.|null} [severities] ZypperSettings severities + * @property {Array.|null} [excludes] ZypperSettings excludes + * @property {Array.|null} [exclusivePatches] ZypperSettings exclusivePatches + */ + + /** + * Constructs a new ZypperSettings. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ZypperSettings. + * @implements IZypperSettings + * @constructor + * @param {google.cloud.osconfig.v1.IZypperSettings=} [properties] Properties to set + */ + function ZypperSettings(properties) { + this.categories = []; + this.severities = []; + this.excludes = []; + this.exclusivePatches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ZypperSettings withOptional. + * @member {boolean} withOptional + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @instance + */ + ZypperSettings.prototype.withOptional = false; + + /** + * ZypperSettings withUpdate. + * @member {boolean} withUpdate + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @instance + */ + ZypperSettings.prototype.withUpdate = false; + + /** + * ZypperSettings categories. + * @member {Array.} categories + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @instance + */ + ZypperSettings.prototype.categories = $util.emptyArray; + + /** + * ZypperSettings severities. + * @member {Array.} severities + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @instance + */ + ZypperSettings.prototype.severities = $util.emptyArray; + + /** + * ZypperSettings excludes. + * @member {Array.} excludes + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @instance + */ + ZypperSettings.prototype.excludes = $util.emptyArray; + + /** + * ZypperSettings exclusivePatches. + * @member {Array.} exclusivePatches + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @instance + */ + ZypperSettings.prototype.exclusivePatches = $util.emptyArray; + + /** + * Creates a new ZypperSettings instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @static + * @param {google.cloud.osconfig.v1.IZypperSettings=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ZypperSettings} ZypperSettings instance + */ + ZypperSettings.create = function create(properties) { + return new ZypperSettings(properties); + }; + + /** + * Encodes the specified ZypperSettings message. Does not implicitly {@link google.cloud.osconfig.v1.ZypperSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @static + * @param {google.cloud.osconfig.v1.IZypperSettings} message ZypperSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.withOptional != null && Object.hasOwnProperty.call(message, "withOptional")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.withOptional); + if (message.withUpdate != null && Object.hasOwnProperty.call(message, "withUpdate")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.withUpdate); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.categories[i]); + if (message.severities != null && message.severities.length) + for (var i = 0; i < message.severities.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.severities[i]); + if (message.excludes != null && message.excludes.length) + for (var i = 0; i < message.excludes.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.excludes[i]); + if (message.exclusivePatches != null && message.exclusivePatches.length) + for (var i = 0; i < message.exclusivePatches.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.exclusivePatches[i]); + return writer; + }; + + /** + * Encodes the specified ZypperSettings message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ZypperSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @static + * @param {google.cloud.osconfig.v1.IZypperSettings} message ZypperSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZypperSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ZypperSettings} ZypperSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ZypperSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.withOptional = reader.bool(); + break; + } + case 2: { + message.withUpdate = reader.bool(); + break; + } + case 3: { + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push(reader.string()); + break; + } + case 4: { + if (!(message.severities && message.severities.length)) + message.severities = []; + message.severities.push(reader.string()); + break; + } + case 5: { + if (!(message.excludes && message.excludes.length)) + message.excludes = []; + message.excludes.push(reader.string()); + break; + } + case 6: { + if (!(message.exclusivePatches && message.exclusivePatches.length)) + message.exclusivePatches = []; + message.exclusivePatches.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZypperSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ZypperSettings} ZypperSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZypperSettings message. + * @function verify + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZypperSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.withOptional != null && message.hasOwnProperty("withOptional")) + if (typeof message.withOptional !== "boolean") + return "withOptional: boolean expected"; + if (message.withUpdate != null && message.hasOwnProperty("withUpdate")) + if (typeof message.withUpdate !== "boolean") + return "withUpdate: boolean expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) + if (!$util.isString(message.categories[i])) + return "categories: string[] expected"; + } + if (message.severities != null && message.hasOwnProperty("severities")) { + if (!Array.isArray(message.severities)) + return "severities: array expected"; + for (var i = 0; i < message.severities.length; ++i) + if (!$util.isString(message.severities[i])) + return "severities: string[] expected"; + } + if (message.excludes != null && message.hasOwnProperty("excludes")) { + if (!Array.isArray(message.excludes)) + return "excludes: array expected"; + for (var i = 0; i < message.excludes.length; ++i) + if (!$util.isString(message.excludes[i])) + return "excludes: string[] expected"; + } + if (message.exclusivePatches != null && message.hasOwnProperty("exclusivePatches")) { + if (!Array.isArray(message.exclusivePatches)) + return "exclusivePatches: array expected"; + for (var i = 0; i < message.exclusivePatches.length; ++i) + if (!$util.isString(message.exclusivePatches[i])) + return "exclusivePatches: string[] expected"; + } + return null; + }; + + /** + * Creates a ZypperSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ZypperSettings} ZypperSettings + */ + ZypperSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ZypperSettings) + return object; + var message = new $root.google.cloud.osconfig.v1.ZypperSettings(); + if (object.withOptional != null) + message.withOptional = Boolean(object.withOptional); + if (object.withUpdate != null) + message.withUpdate = Boolean(object.withUpdate); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.osconfig.v1.ZypperSettings.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) + message.categories[i] = String(object.categories[i]); + } + if (object.severities) { + if (!Array.isArray(object.severities)) + throw TypeError(".google.cloud.osconfig.v1.ZypperSettings.severities: array expected"); + message.severities = []; + for (var i = 0; i < object.severities.length; ++i) + message.severities[i] = String(object.severities[i]); + } + if (object.excludes) { + if (!Array.isArray(object.excludes)) + throw TypeError(".google.cloud.osconfig.v1.ZypperSettings.excludes: array expected"); + message.excludes = []; + for (var i = 0; i < object.excludes.length; ++i) + message.excludes[i] = String(object.excludes[i]); + } + if (object.exclusivePatches) { + if (!Array.isArray(object.exclusivePatches)) + throw TypeError(".google.cloud.osconfig.v1.ZypperSettings.exclusivePatches: array expected"); + message.exclusivePatches = []; + for (var i = 0; i < object.exclusivePatches.length; ++i) + message.exclusivePatches[i] = String(object.exclusivePatches[i]); + } + return message; + }; + + /** + * Creates a plain object from a ZypperSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @static + * @param {google.cloud.osconfig.v1.ZypperSettings} message ZypperSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZypperSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.categories = []; + object.severities = []; + object.excludes = []; + object.exclusivePatches = []; + } + if (options.defaults) { + object.withOptional = false; + object.withUpdate = false; + } + if (message.withOptional != null && message.hasOwnProperty("withOptional")) + object.withOptional = message.withOptional; + if (message.withUpdate != null && message.hasOwnProperty("withUpdate")) + object.withUpdate = message.withUpdate; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = message.categories[j]; + } + if (message.severities && message.severities.length) { + object.severities = []; + for (var j = 0; j < message.severities.length; ++j) + object.severities[j] = message.severities[j]; + } + if (message.excludes && message.excludes.length) { + object.excludes = []; + for (var j = 0; j < message.excludes.length; ++j) + object.excludes[j] = message.excludes[j]; + } + if (message.exclusivePatches && message.exclusivePatches.length) { + object.exclusivePatches = []; + for (var j = 0; j < message.exclusivePatches.length; ++j) + object.exclusivePatches[j] = message.exclusivePatches[j]; + } + return object; + }; + + /** + * Converts this ZypperSettings to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @instance + * @returns {Object.} JSON object + */ + ZypperSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ZypperSettings + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ZypperSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ZypperSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ZypperSettings"; + }; + + return ZypperSettings; + })(); + + v1.WindowsUpdateSettings = (function() { + + /** + * Properties of a WindowsUpdateSettings. + * @memberof google.cloud.osconfig.v1 + * @interface IWindowsUpdateSettings + * @property {Array.|null} [classifications] WindowsUpdateSettings classifications + * @property {Array.|null} [excludes] WindowsUpdateSettings excludes + * @property {Array.|null} [exclusivePatches] WindowsUpdateSettings exclusivePatches + */ + + /** + * Constructs a new WindowsUpdateSettings. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a WindowsUpdateSettings. + * @implements IWindowsUpdateSettings + * @constructor + * @param {google.cloud.osconfig.v1.IWindowsUpdateSettings=} [properties] Properties to set + */ + function WindowsUpdateSettings(properties) { + this.classifications = []; + this.excludes = []; + this.exclusivePatches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowsUpdateSettings classifications. + * @member {Array.} classifications + * @memberof google.cloud.osconfig.v1.WindowsUpdateSettings + * @instance + */ + WindowsUpdateSettings.prototype.classifications = $util.emptyArray; + + /** + * WindowsUpdateSettings excludes. + * @member {Array.} excludes + * @memberof google.cloud.osconfig.v1.WindowsUpdateSettings + * @instance + */ + WindowsUpdateSettings.prototype.excludes = $util.emptyArray; + + /** + * WindowsUpdateSettings exclusivePatches. + * @member {Array.} exclusivePatches + * @memberof google.cloud.osconfig.v1.WindowsUpdateSettings + * @instance + */ + WindowsUpdateSettings.prototype.exclusivePatches = $util.emptyArray; + + /** + * Creates a new WindowsUpdateSettings instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.WindowsUpdateSettings + * @static + * @param {google.cloud.osconfig.v1.IWindowsUpdateSettings=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.WindowsUpdateSettings} WindowsUpdateSettings instance + */ + WindowsUpdateSettings.create = function create(properties) { + return new WindowsUpdateSettings(properties); + }; + + /** + * Encodes the specified WindowsUpdateSettings message. Does not implicitly {@link google.cloud.osconfig.v1.WindowsUpdateSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.WindowsUpdateSettings + * @static + * @param {google.cloud.osconfig.v1.IWindowsUpdateSettings} message WindowsUpdateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classifications != null && message.classifications.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.classifications.length; ++i) + writer.int32(message.classifications[i]); + writer.ldelim(); + } + if (message.excludes != null && message.excludes.length) + for (var i = 0; i < message.excludes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.excludes[i]); + if (message.exclusivePatches != null && message.exclusivePatches.length) + for (var i = 0; i < message.exclusivePatches.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exclusivePatches[i]); + return writer; + }; + + /** + * Encodes the specified WindowsUpdateSettings message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.WindowsUpdateSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.WindowsUpdateSettings + * @static + * @param {google.cloud.osconfig.v1.IWindowsUpdateSettings} message WindowsUpdateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsUpdateSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.WindowsUpdateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.WindowsUpdateSettings} WindowsUpdateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.WindowsUpdateSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.classifications && message.classifications.length)) + message.classifications = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.classifications.push(reader.int32()); + } else + message.classifications.push(reader.int32()); + break; + } + case 2: { + if (!(message.excludes && message.excludes.length)) + message.excludes = []; + message.excludes.push(reader.string()); + break; + } + case 3: { + if (!(message.exclusivePatches && message.exclusivePatches.length)) + message.exclusivePatches = []; + message.exclusivePatches.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsUpdateSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.WindowsUpdateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.WindowsUpdateSettings} WindowsUpdateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsUpdateSettings message. + * @function verify + * @memberof google.cloud.osconfig.v1.WindowsUpdateSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsUpdateSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classifications != null && message.hasOwnProperty("classifications")) { + if (!Array.isArray(message.classifications)) + return "classifications: array expected"; + for (var i = 0; i < message.classifications.length; ++i) + switch (message.classifications[i]) { + default: + return "classifications: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.excludes != null && message.hasOwnProperty("excludes")) { + if (!Array.isArray(message.excludes)) + return "excludes: array expected"; + for (var i = 0; i < message.excludes.length; ++i) + if (!$util.isString(message.excludes[i])) + return "excludes: string[] expected"; + } + if (message.exclusivePatches != null && message.hasOwnProperty("exclusivePatches")) { + if (!Array.isArray(message.exclusivePatches)) + return "exclusivePatches: array expected"; + for (var i = 0; i < message.exclusivePatches.length; ++i) + if (!$util.isString(message.exclusivePatches[i])) + return "exclusivePatches: string[] expected"; + } + return null; + }; + + /** + * Creates a WindowsUpdateSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.WindowsUpdateSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.WindowsUpdateSettings} WindowsUpdateSettings + */ + WindowsUpdateSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.WindowsUpdateSettings) + return object; + var message = new $root.google.cloud.osconfig.v1.WindowsUpdateSettings(); + if (object.classifications) { + if (!Array.isArray(object.classifications)) + throw TypeError(".google.cloud.osconfig.v1.WindowsUpdateSettings.classifications: array expected"); + message.classifications = []; + for (var i = 0; i < object.classifications.length; ++i) + switch (object.classifications[i]) { + default: + if (typeof object.classifications[i] === "number") { + message.classifications[i] = object.classifications[i]; + break; + } + case "CLASSIFICATION_UNSPECIFIED": + case 0: + message.classifications[i] = 0; + break; + case "CRITICAL": + case 1: + message.classifications[i] = 1; + break; + case "SECURITY": + case 2: + message.classifications[i] = 2; + break; + case "DEFINITION": + case 3: + message.classifications[i] = 3; + break; + case "DRIVER": + case 4: + message.classifications[i] = 4; + break; + case "FEATURE_PACK": + case 5: + message.classifications[i] = 5; + break; + case "SERVICE_PACK": + case 6: + message.classifications[i] = 6; + break; + case "TOOL": + case 7: + message.classifications[i] = 7; + break; + case "UPDATE_ROLLUP": + case 8: + message.classifications[i] = 8; + break; + case "UPDATE": + case 9: + message.classifications[i] = 9; + break; + } + } + if (object.excludes) { + if (!Array.isArray(object.excludes)) + throw TypeError(".google.cloud.osconfig.v1.WindowsUpdateSettings.excludes: array expected"); + message.excludes = []; + for (var i = 0; i < object.excludes.length; ++i) + message.excludes[i] = String(object.excludes[i]); + } + if (object.exclusivePatches) { + if (!Array.isArray(object.exclusivePatches)) + throw TypeError(".google.cloud.osconfig.v1.WindowsUpdateSettings.exclusivePatches: array expected"); + message.exclusivePatches = []; + for (var i = 0; i < object.exclusivePatches.length; ++i) + message.exclusivePatches[i] = String(object.exclusivePatches[i]); + } + return message; + }; + + /** + * Creates a plain object from a WindowsUpdateSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.WindowsUpdateSettings + * @static + * @param {google.cloud.osconfig.v1.WindowsUpdateSettings} message WindowsUpdateSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsUpdateSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.classifications = []; + object.excludes = []; + object.exclusivePatches = []; + } + if (message.classifications && message.classifications.length) { + object.classifications = []; + for (var j = 0; j < message.classifications.length; ++j) + object.classifications[j] = options.enums === String ? $root.google.cloud.osconfig.v1.WindowsUpdateSettings.Classification[message.classifications[j]] === undefined ? message.classifications[j] : $root.google.cloud.osconfig.v1.WindowsUpdateSettings.Classification[message.classifications[j]] : message.classifications[j]; + } + if (message.excludes && message.excludes.length) { + object.excludes = []; + for (var j = 0; j < message.excludes.length; ++j) + object.excludes[j] = message.excludes[j]; + } + if (message.exclusivePatches && message.exclusivePatches.length) { + object.exclusivePatches = []; + for (var j = 0; j < message.exclusivePatches.length; ++j) + object.exclusivePatches[j] = message.exclusivePatches[j]; + } + return object; + }; + + /** + * Converts this WindowsUpdateSettings to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.WindowsUpdateSettings + * @instance + * @returns {Object.} JSON object + */ + WindowsUpdateSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowsUpdateSettings + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.WindowsUpdateSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsUpdateSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.WindowsUpdateSettings"; + }; + + /** + * Classification enum. + * @name google.cloud.osconfig.v1.WindowsUpdateSettings.Classification + * @enum {number} + * @property {number} CLASSIFICATION_UNSPECIFIED=0 CLASSIFICATION_UNSPECIFIED value + * @property {number} CRITICAL=1 CRITICAL value + * @property {number} SECURITY=2 SECURITY value + * @property {number} DEFINITION=3 DEFINITION value + * @property {number} DRIVER=4 DRIVER value + * @property {number} FEATURE_PACK=5 FEATURE_PACK value + * @property {number} SERVICE_PACK=6 SERVICE_PACK value + * @property {number} TOOL=7 TOOL value + * @property {number} UPDATE_ROLLUP=8 UPDATE_ROLLUP value + * @property {number} UPDATE=9 UPDATE value + */ + WindowsUpdateSettings.Classification = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLASSIFICATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CRITICAL"] = 1; + values[valuesById[2] = "SECURITY"] = 2; + values[valuesById[3] = "DEFINITION"] = 3; + values[valuesById[4] = "DRIVER"] = 4; + values[valuesById[5] = "FEATURE_PACK"] = 5; + values[valuesById[6] = "SERVICE_PACK"] = 6; + values[valuesById[7] = "TOOL"] = 7; + values[valuesById[8] = "UPDATE_ROLLUP"] = 8; + values[valuesById[9] = "UPDATE"] = 9; + return values; + })(); + + return WindowsUpdateSettings; + })(); + + v1.ExecStep = (function() { + + /** + * Properties of an ExecStep. + * @memberof google.cloud.osconfig.v1 + * @interface IExecStep + * @property {google.cloud.osconfig.v1.IExecStepConfig|null} [linuxExecStepConfig] ExecStep linuxExecStepConfig + * @property {google.cloud.osconfig.v1.IExecStepConfig|null} [windowsExecStepConfig] ExecStep windowsExecStepConfig + */ + + /** + * Constructs a new ExecStep. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an ExecStep. + * @implements IExecStep + * @constructor + * @param {google.cloud.osconfig.v1.IExecStep=} [properties] Properties to set + */ + function ExecStep(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecStep linuxExecStepConfig. + * @member {google.cloud.osconfig.v1.IExecStepConfig|null|undefined} linuxExecStepConfig + * @memberof google.cloud.osconfig.v1.ExecStep + * @instance + */ + ExecStep.prototype.linuxExecStepConfig = null; + + /** + * ExecStep windowsExecStepConfig. + * @member {google.cloud.osconfig.v1.IExecStepConfig|null|undefined} windowsExecStepConfig + * @memberof google.cloud.osconfig.v1.ExecStep + * @instance + */ + ExecStep.prototype.windowsExecStepConfig = null; + + /** + * Creates a new ExecStep instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ExecStep + * @static + * @param {google.cloud.osconfig.v1.IExecStep=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ExecStep} ExecStep instance + */ + ExecStep.create = function create(properties) { + return new ExecStep(properties); + }; + + /** + * Encodes the specified ExecStep message. Does not implicitly {@link google.cloud.osconfig.v1.ExecStep.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ExecStep + * @static + * @param {google.cloud.osconfig.v1.IExecStep} message ExecStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecStep.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.linuxExecStepConfig != null && Object.hasOwnProperty.call(message, "linuxExecStepConfig")) + $root.google.cloud.osconfig.v1.ExecStepConfig.encode(message.linuxExecStepConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.windowsExecStepConfig != null && Object.hasOwnProperty.call(message, "windowsExecStepConfig")) + $root.google.cloud.osconfig.v1.ExecStepConfig.encode(message.windowsExecStepConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecStep message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ExecStep.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ExecStep + * @static + * @param {google.cloud.osconfig.v1.IExecStep} message ExecStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecStep.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecStep message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ExecStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ExecStep} ExecStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecStep.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ExecStep(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.linuxExecStepConfig = $root.google.cloud.osconfig.v1.ExecStepConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.windowsExecStepConfig = $root.google.cloud.osconfig.v1.ExecStepConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecStep message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ExecStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ExecStep} ExecStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecStep.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecStep message. + * @function verify + * @memberof google.cloud.osconfig.v1.ExecStep + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecStep.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.linuxExecStepConfig != null && message.hasOwnProperty("linuxExecStepConfig")) { + var error = $root.google.cloud.osconfig.v1.ExecStepConfig.verify(message.linuxExecStepConfig); + if (error) + return "linuxExecStepConfig." + error; + } + if (message.windowsExecStepConfig != null && message.hasOwnProperty("windowsExecStepConfig")) { + var error = $root.google.cloud.osconfig.v1.ExecStepConfig.verify(message.windowsExecStepConfig); + if (error) + return "windowsExecStepConfig." + error; + } + return null; + }; + + /** + * Creates an ExecStep message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ExecStep + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ExecStep} ExecStep + */ + ExecStep.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ExecStep) + return object; + var message = new $root.google.cloud.osconfig.v1.ExecStep(); + if (object.linuxExecStepConfig != null) { + if (typeof object.linuxExecStepConfig !== "object") + throw TypeError(".google.cloud.osconfig.v1.ExecStep.linuxExecStepConfig: object expected"); + message.linuxExecStepConfig = $root.google.cloud.osconfig.v1.ExecStepConfig.fromObject(object.linuxExecStepConfig); + } + if (object.windowsExecStepConfig != null) { + if (typeof object.windowsExecStepConfig !== "object") + throw TypeError(".google.cloud.osconfig.v1.ExecStep.windowsExecStepConfig: object expected"); + message.windowsExecStepConfig = $root.google.cloud.osconfig.v1.ExecStepConfig.fromObject(object.windowsExecStepConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExecStep message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ExecStep + * @static + * @param {google.cloud.osconfig.v1.ExecStep} message ExecStep + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecStep.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.linuxExecStepConfig = null; + object.windowsExecStepConfig = null; + } + if (message.linuxExecStepConfig != null && message.hasOwnProperty("linuxExecStepConfig")) + object.linuxExecStepConfig = $root.google.cloud.osconfig.v1.ExecStepConfig.toObject(message.linuxExecStepConfig, options); + if (message.windowsExecStepConfig != null && message.hasOwnProperty("windowsExecStepConfig")) + object.windowsExecStepConfig = $root.google.cloud.osconfig.v1.ExecStepConfig.toObject(message.windowsExecStepConfig, options); + return object; + }; + + /** + * Converts this ExecStep to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ExecStep + * @instance + * @returns {Object.} JSON object + */ + ExecStep.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecStep + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ExecStep + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ExecStep"; + }; + + return ExecStep; + })(); + + v1.ExecStepConfig = (function() { + + /** + * Properties of an ExecStepConfig. + * @memberof google.cloud.osconfig.v1 + * @interface IExecStepConfig + * @property {string|null} [localPath] ExecStepConfig localPath + * @property {google.cloud.osconfig.v1.IGcsObject|null} [gcsObject] ExecStepConfig gcsObject + * @property {Array.|null} [allowedSuccessCodes] ExecStepConfig allowedSuccessCodes + * @property {google.cloud.osconfig.v1.ExecStepConfig.Interpreter|null} [interpreter] ExecStepConfig interpreter + */ + + /** + * Constructs a new ExecStepConfig. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an ExecStepConfig. + * @implements IExecStepConfig + * @constructor + * @param {google.cloud.osconfig.v1.IExecStepConfig=} [properties] Properties to set + */ + function ExecStepConfig(properties) { + this.allowedSuccessCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecStepConfig localPath. + * @member {string|null|undefined} localPath + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @instance + */ + ExecStepConfig.prototype.localPath = null; + + /** + * ExecStepConfig gcsObject. + * @member {google.cloud.osconfig.v1.IGcsObject|null|undefined} gcsObject + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @instance + */ + ExecStepConfig.prototype.gcsObject = null; + + /** + * ExecStepConfig allowedSuccessCodes. + * @member {Array.} allowedSuccessCodes + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @instance + */ + ExecStepConfig.prototype.allowedSuccessCodes = $util.emptyArray; + + /** + * ExecStepConfig interpreter. + * @member {google.cloud.osconfig.v1.ExecStepConfig.Interpreter} interpreter + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @instance + */ + ExecStepConfig.prototype.interpreter = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecStepConfig executable. + * @member {"localPath"|"gcsObject"|undefined} executable + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @instance + */ + Object.defineProperty(ExecStepConfig.prototype, "executable", { + get: $util.oneOfGetter($oneOfFields = ["localPath", "gcsObject"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecStepConfig instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @static + * @param {google.cloud.osconfig.v1.IExecStepConfig=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ExecStepConfig} ExecStepConfig instance + */ + ExecStepConfig.create = function create(properties) { + return new ExecStepConfig(properties); + }; + + /** + * Encodes the specified ExecStepConfig message. Does not implicitly {@link google.cloud.osconfig.v1.ExecStepConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @static + * @param {google.cloud.osconfig.v1.IExecStepConfig} message ExecStepConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecStepConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.localPath != null && Object.hasOwnProperty.call(message, "localPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.localPath); + if (message.gcsObject != null && Object.hasOwnProperty.call(message, "gcsObject")) + $root.google.cloud.osconfig.v1.GcsObject.encode(message.gcsObject, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.allowedSuccessCodes != null && message.allowedSuccessCodes.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.allowedSuccessCodes.length; ++i) + writer.int32(message.allowedSuccessCodes[i]); + writer.ldelim(); + } + if (message.interpreter != null && Object.hasOwnProperty.call(message, "interpreter")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.interpreter); + return writer; + }; + + /** + * Encodes the specified ExecStepConfig message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ExecStepConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @static + * @param {google.cloud.osconfig.v1.IExecStepConfig} message ExecStepConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecStepConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecStepConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ExecStepConfig} ExecStepConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecStepConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ExecStepConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.localPath = reader.string(); + break; + } + case 2: { + message.gcsObject = $root.google.cloud.osconfig.v1.GcsObject.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.allowedSuccessCodes && message.allowedSuccessCodes.length)) + message.allowedSuccessCodes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedSuccessCodes.push(reader.int32()); + } else + message.allowedSuccessCodes.push(reader.int32()); + break; + } + case 4: { + message.interpreter = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecStepConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ExecStepConfig} ExecStepConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecStepConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecStepConfig message. + * @function verify + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecStepConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.localPath != null && message.hasOwnProperty("localPath")) { + properties.executable = 1; + if (!$util.isString(message.localPath)) + return "localPath: string expected"; + } + if (message.gcsObject != null && message.hasOwnProperty("gcsObject")) { + if (properties.executable === 1) + return "executable: multiple values"; + properties.executable = 1; + { + var error = $root.google.cloud.osconfig.v1.GcsObject.verify(message.gcsObject); + if (error) + return "gcsObject." + error; + } + } + if (message.allowedSuccessCodes != null && message.hasOwnProperty("allowedSuccessCodes")) { + if (!Array.isArray(message.allowedSuccessCodes)) + return "allowedSuccessCodes: array expected"; + for (var i = 0; i < message.allowedSuccessCodes.length; ++i) + if (!$util.isInteger(message.allowedSuccessCodes[i])) + return "allowedSuccessCodes: integer[] expected"; + } + if (message.interpreter != null && message.hasOwnProperty("interpreter")) + switch (message.interpreter) { + default: + return "interpreter: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ExecStepConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ExecStepConfig} ExecStepConfig + */ + ExecStepConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ExecStepConfig) + return object; + var message = new $root.google.cloud.osconfig.v1.ExecStepConfig(); + if (object.localPath != null) + message.localPath = String(object.localPath); + if (object.gcsObject != null) { + if (typeof object.gcsObject !== "object") + throw TypeError(".google.cloud.osconfig.v1.ExecStepConfig.gcsObject: object expected"); + message.gcsObject = $root.google.cloud.osconfig.v1.GcsObject.fromObject(object.gcsObject); + } + if (object.allowedSuccessCodes) { + if (!Array.isArray(object.allowedSuccessCodes)) + throw TypeError(".google.cloud.osconfig.v1.ExecStepConfig.allowedSuccessCodes: array expected"); + message.allowedSuccessCodes = []; + for (var i = 0; i < object.allowedSuccessCodes.length; ++i) + message.allowedSuccessCodes[i] = object.allowedSuccessCodes[i] | 0; + } + switch (object.interpreter) { + default: + if (typeof object.interpreter === "number") { + message.interpreter = object.interpreter; + break; + } + break; + case "INTERPRETER_UNSPECIFIED": + case 0: + message.interpreter = 0; + break; + case "SHELL": + case 1: + message.interpreter = 1; + break; + case "POWERSHELL": + case 2: + message.interpreter = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExecStepConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @static + * @param {google.cloud.osconfig.v1.ExecStepConfig} message ExecStepConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecStepConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedSuccessCodes = []; + if (options.defaults) + object.interpreter = options.enums === String ? "INTERPRETER_UNSPECIFIED" : 0; + if (message.localPath != null && message.hasOwnProperty("localPath")) { + object.localPath = message.localPath; + if (options.oneofs) + object.executable = "localPath"; + } + if (message.gcsObject != null && message.hasOwnProperty("gcsObject")) { + object.gcsObject = $root.google.cloud.osconfig.v1.GcsObject.toObject(message.gcsObject, options); + if (options.oneofs) + object.executable = "gcsObject"; + } + if (message.allowedSuccessCodes && message.allowedSuccessCodes.length) { + object.allowedSuccessCodes = []; + for (var j = 0; j < message.allowedSuccessCodes.length; ++j) + object.allowedSuccessCodes[j] = message.allowedSuccessCodes[j]; + } + if (message.interpreter != null && message.hasOwnProperty("interpreter")) + object.interpreter = options.enums === String ? $root.google.cloud.osconfig.v1.ExecStepConfig.Interpreter[message.interpreter] === undefined ? message.interpreter : $root.google.cloud.osconfig.v1.ExecStepConfig.Interpreter[message.interpreter] : message.interpreter; + return object; + }; + + /** + * Converts this ExecStepConfig to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @instance + * @returns {Object.} JSON object + */ + ExecStepConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecStepConfig + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ExecStepConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecStepConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ExecStepConfig"; + }; + + /** + * Interpreter enum. + * @name google.cloud.osconfig.v1.ExecStepConfig.Interpreter + * @enum {number} + * @property {number} INTERPRETER_UNSPECIFIED=0 INTERPRETER_UNSPECIFIED value + * @property {number} SHELL=1 SHELL value + * @property {number} POWERSHELL=2 POWERSHELL value + */ + ExecStepConfig.Interpreter = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERPRETER_UNSPECIFIED"] = 0; + values[valuesById[1] = "SHELL"] = 1; + values[valuesById[2] = "POWERSHELL"] = 2; + return values; + })(); + + return ExecStepConfig; + })(); + + v1.GcsObject = (function() { + + /** + * Properties of a GcsObject. + * @memberof google.cloud.osconfig.v1 + * @interface IGcsObject + * @property {string|null} [bucket] GcsObject bucket + * @property {string|null} [object] GcsObject object + * @property {number|Long|null} [generationNumber] GcsObject generationNumber + */ + + /** + * Constructs a new GcsObject. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a GcsObject. + * @implements IGcsObject + * @constructor + * @param {google.cloud.osconfig.v1.IGcsObject=} [properties] Properties to set + */ + function GcsObject(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsObject bucket. + * @member {string} bucket + * @memberof google.cloud.osconfig.v1.GcsObject + * @instance + */ + GcsObject.prototype.bucket = ""; + + /** + * GcsObject object. + * @member {string} object + * @memberof google.cloud.osconfig.v1.GcsObject + * @instance + */ + GcsObject.prototype.object = ""; + + /** + * GcsObject generationNumber. + * @member {number|Long} generationNumber + * @memberof google.cloud.osconfig.v1.GcsObject + * @instance + */ + GcsObject.prototype.generationNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new GcsObject instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.GcsObject + * @static + * @param {google.cloud.osconfig.v1.IGcsObject=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.GcsObject} GcsObject instance + */ + GcsObject.create = function create(properties) { + return new GcsObject(properties); + }; + + /** + * Encodes the specified GcsObject message. Does not implicitly {@link google.cloud.osconfig.v1.GcsObject.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.GcsObject + * @static + * @param {google.cloud.osconfig.v1.IGcsObject} message GcsObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsObject.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); + if (message.generationNumber != null && Object.hasOwnProperty.call(message, "generationNumber")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generationNumber); + return writer; + }; + + /** + * Encodes the specified GcsObject message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GcsObject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.GcsObject + * @static + * @param {google.cloud.osconfig.v1.IGcsObject} message GcsObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsObject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsObject message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.GcsObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.GcsObject} GcsObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsObject.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.GcsObject(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.object = reader.string(); + break; + } + case 3: { + message.generationNumber = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsObject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.GcsObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.GcsObject} GcsObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsObject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsObject message. + * @function verify + * @memberof google.cloud.osconfig.v1.GcsObject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsObject.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.object != null && message.hasOwnProperty("object")) + if (!$util.isString(message.object)) + return "object: string expected"; + if (message.generationNumber != null && message.hasOwnProperty("generationNumber")) + if (!$util.isInteger(message.generationNumber) && !(message.generationNumber && $util.isInteger(message.generationNumber.low) && $util.isInteger(message.generationNumber.high))) + return "generationNumber: integer|Long expected"; + return null; + }; + + /** + * Creates a GcsObject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.GcsObject + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.GcsObject} GcsObject + */ + GcsObject.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.GcsObject) + return object; + var message = new $root.google.cloud.osconfig.v1.GcsObject(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.object != null) + message.object = String(object.object); + if (object.generationNumber != null) + if ($util.Long) + (message.generationNumber = $util.Long.fromValue(object.generationNumber)).unsigned = false; + else if (typeof object.generationNumber === "string") + message.generationNumber = parseInt(object.generationNumber, 10); + else if (typeof object.generationNumber === "number") + message.generationNumber = object.generationNumber; + else if (typeof object.generationNumber === "object") + message.generationNumber = new $util.LongBits(object.generationNumber.low >>> 0, object.generationNumber.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GcsObject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.GcsObject + * @static + * @param {google.cloud.osconfig.v1.GcsObject} message GcsObject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsObject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.object = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generationNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generationNumber = options.longs === String ? "0" : 0; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.object != null && message.hasOwnProperty("object")) + object.object = message.object; + if (message.generationNumber != null && message.hasOwnProperty("generationNumber")) + if (typeof message.generationNumber === "number") + object.generationNumber = options.longs === String ? String(message.generationNumber) : message.generationNumber; + else + object.generationNumber = options.longs === String ? $util.Long.prototype.toString.call(message.generationNumber) : options.longs === Number ? new $util.LongBits(message.generationNumber.low >>> 0, message.generationNumber.high >>> 0).toNumber() : message.generationNumber; + return object; + }; + + /** + * Converts this GcsObject to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.GcsObject + * @instance + * @returns {Object.} JSON object + */ + GcsObject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsObject + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.GcsObject + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsObject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.GcsObject"; + }; + + return GcsObject; + })(); + + v1.PatchInstanceFilter = (function() { + + /** + * Properties of a PatchInstanceFilter. + * @memberof google.cloud.osconfig.v1 + * @interface IPatchInstanceFilter + * @property {boolean|null} [all] PatchInstanceFilter all + * @property {Array.|null} [groupLabels] PatchInstanceFilter groupLabels + * @property {Array.|null} [zones] PatchInstanceFilter zones + * @property {Array.|null} [instances] PatchInstanceFilter instances + * @property {Array.|null} [instanceNamePrefixes] PatchInstanceFilter instanceNamePrefixes + */ + + /** + * Constructs a new PatchInstanceFilter. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a PatchInstanceFilter. + * @implements IPatchInstanceFilter + * @constructor + * @param {google.cloud.osconfig.v1.IPatchInstanceFilter=} [properties] Properties to set + */ + function PatchInstanceFilter(properties) { + this.groupLabels = []; + this.zones = []; + this.instances = []; + this.instanceNamePrefixes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchInstanceFilter all. + * @member {boolean} all + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @instance + */ + PatchInstanceFilter.prototype.all = false; + + /** + * PatchInstanceFilter groupLabels. + * @member {Array.} groupLabels + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @instance + */ + PatchInstanceFilter.prototype.groupLabels = $util.emptyArray; + + /** + * PatchInstanceFilter zones. + * @member {Array.} zones + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @instance + */ + PatchInstanceFilter.prototype.zones = $util.emptyArray; + + /** + * PatchInstanceFilter instances. + * @member {Array.} instances + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @instance + */ + PatchInstanceFilter.prototype.instances = $util.emptyArray; + + /** + * PatchInstanceFilter instanceNamePrefixes. + * @member {Array.} instanceNamePrefixes + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @instance + */ + PatchInstanceFilter.prototype.instanceNamePrefixes = $util.emptyArray; + + /** + * Creates a new PatchInstanceFilter instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @static + * @param {google.cloud.osconfig.v1.IPatchInstanceFilter=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.PatchInstanceFilter} PatchInstanceFilter instance + */ + PatchInstanceFilter.create = function create(properties) { + return new PatchInstanceFilter(properties); + }; + + /** + * Encodes the specified PatchInstanceFilter message. Does not implicitly {@link google.cloud.osconfig.v1.PatchInstanceFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @static + * @param {google.cloud.osconfig.v1.IPatchInstanceFilter} message PatchInstanceFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchInstanceFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.all != null && Object.hasOwnProperty.call(message, "all")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.all); + if (message.groupLabels != null && message.groupLabels.length) + for (var i = 0; i < message.groupLabels.length; ++i) + $root.google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel.encode(message.groupLabels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.zones != null && message.zones.length) + for (var i = 0; i < message.zones.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.zones[i]); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.instances[i]); + if (message.instanceNamePrefixes != null && message.instanceNamePrefixes.length) + for (var i = 0; i < message.instanceNamePrefixes.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.instanceNamePrefixes[i]); + return writer; + }; + + /** + * Encodes the specified PatchInstanceFilter message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchInstanceFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @static + * @param {google.cloud.osconfig.v1.IPatchInstanceFilter} message PatchInstanceFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchInstanceFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchInstanceFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.PatchInstanceFilter} PatchInstanceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchInstanceFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.PatchInstanceFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.all = reader.bool(); + break; + } + case 2: { + if (!(message.groupLabels && message.groupLabels.length)) + message.groupLabels = []; + message.groupLabels.push($root.google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.zones && message.zones.length)) + message.zones = []; + message.zones.push(reader.string()); + break; + } + case 4: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push(reader.string()); + break; + } + case 5: { + if (!(message.instanceNamePrefixes && message.instanceNamePrefixes.length)) + message.instanceNamePrefixes = []; + message.instanceNamePrefixes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchInstanceFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.PatchInstanceFilter} PatchInstanceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchInstanceFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchInstanceFilter message. + * @function verify + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchInstanceFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.all != null && message.hasOwnProperty("all")) + if (typeof message.all !== "boolean") + return "all: boolean expected"; + if (message.groupLabels != null && message.hasOwnProperty("groupLabels")) { + if (!Array.isArray(message.groupLabels)) + return "groupLabels: array expected"; + for (var i = 0; i < message.groupLabels.length; ++i) { + var error = $root.google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel.verify(message.groupLabels[i]); + if (error) + return "groupLabels." + error; + } + } + if (message.zones != null && message.hasOwnProperty("zones")) { + if (!Array.isArray(message.zones)) + return "zones: array expected"; + for (var i = 0; i < message.zones.length; ++i) + if (!$util.isString(message.zones[i])) + return "zones: string[] expected"; + } + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) + if (!$util.isString(message.instances[i])) + return "instances: string[] expected"; + } + if (message.instanceNamePrefixes != null && message.hasOwnProperty("instanceNamePrefixes")) { + if (!Array.isArray(message.instanceNamePrefixes)) + return "instanceNamePrefixes: array expected"; + for (var i = 0; i < message.instanceNamePrefixes.length; ++i) + if (!$util.isString(message.instanceNamePrefixes[i])) + return "instanceNamePrefixes: string[] expected"; + } + return null; + }; + + /** + * Creates a PatchInstanceFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.PatchInstanceFilter} PatchInstanceFilter + */ + PatchInstanceFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.PatchInstanceFilter) + return object; + var message = new $root.google.cloud.osconfig.v1.PatchInstanceFilter(); + if (object.all != null) + message.all = Boolean(object.all); + if (object.groupLabels) { + if (!Array.isArray(object.groupLabels)) + throw TypeError(".google.cloud.osconfig.v1.PatchInstanceFilter.groupLabels: array expected"); + message.groupLabels = []; + for (var i = 0; i < object.groupLabels.length; ++i) { + if (typeof object.groupLabels[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchInstanceFilter.groupLabels: object expected"); + message.groupLabels[i] = $root.google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel.fromObject(object.groupLabels[i]); + } + } + if (object.zones) { + if (!Array.isArray(object.zones)) + throw TypeError(".google.cloud.osconfig.v1.PatchInstanceFilter.zones: array expected"); + message.zones = []; + for (var i = 0; i < object.zones.length; ++i) + message.zones[i] = String(object.zones[i]); + } + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.osconfig.v1.PatchInstanceFilter.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) + message.instances[i] = String(object.instances[i]); + } + if (object.instanceNamePrefixes) { + if (!Array.isArray(object.instanceNamePrefixes)) + throw TypeError(".google.cloud.osconfig.v1.PatchInstanceFilter.instanceNamePrefixes: array expected"); + message.instanceNamePrefixes = []; + for (var i = 0; i < object.instanceNamePrefixes.length; ++i) + message.instanceNamePrefixes[i] = String(object.instanceNamePrefixes[i]); + } + return message; + }; + + /** + * Creates a plain object from a PatchInstanceFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @static + * @param {google.cloud.osconfig.v1.PatchInstanceFilter} message PatchInstanceFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchInstanceFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.groupLabels = []; + object.zones = []; + object.instances = []; + object.instanceNamePrefixes = []; + } + if (options.defaults) + object.all = false; + if (message.all != null && message.hasOwnProperty("all")) + object.all = message.all; + if (message.groupLabels && message.groupLabels.length) { + object.groupLabels = []; + for (var j = 0; j < message.groupLabels.length; ++j) + object.groupLabels[j] = $root.google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel.toObject(message.groupLabels[j], options); + } + if (message.zones && message.zones.length) { + object.zones = []; + for (var j = 0; j < message.zones.length; ++j) + object.zones[j] = message.zones[j]; + } + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = message.instances[j]; + } + if (message.instanceNamePrefixes && message.instanceNamePrefixes.length) { + object.instanceNamePrefixes = []; + for (var j = 0; j < message.instanceNamePrefixes.length; ++j) + object.instanceNamePrefixes[j] = message.instanceNamePrefixes[j]; + } + return object; + }; + + /** + * Converts this PatchInstanceFilter to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @instance + * @returns {Object.} JSON object + */ + PatchInstanceFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PatchInstanceFilter + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PatchInstanceFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.PatchInstanceFilter"; + }; + + PatchInstanceFilter.GroupLabel = (function() { + + /** + * Properties of a GroupLabel. + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @interface IGroupLabel + * @property {Object.|null} [labels] GroupLabel labels + */ + + /** + * Constructs a new GroupLabel. + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter + * @classdesc Represents a GroupLabel. + * @implements IGroupLabel + * @constructor + * @param {google.cloud.osconfig.v1.PatchInstanceFilter.IGroupLabel=} [properties] Properties to set + */ + function GroupLabel(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]]; + } + + /** + * GroupLabel labels. + * @member {Object.} labels + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel + * @instance + */ + GroupLabel.prototype.labels = $util.emptyObject; + + /** + * Creates a new GroupLabel instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel + * @static + * @param {google.cloud.osconfig.v1.PatchInstanceFilter.IGroupLabel=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel} GroupLabel instance + */ + GroupLabel.create = function create(properties) { + return new GroupLabel(properties); + }; + + /** + * Encodes the specified GroupLabel message. Does not implicitly {@link google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel + * @static + * @param {google.cloud.osconfig.v1.PatchInstanceFilter.IGroupLabel} message GroupLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupLabel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupLabel message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel + * @static + * @param {google.cloud.osconfig.v1.PatchInstanceFilter.IGroupLabel} message GroupLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupLabel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupLabel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel} GroupLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupLabel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupLabel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel} GroupLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupLabel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupLabel message. + * @function verify + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupLabel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a GroupLabel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel} GroupLabel + */ + GroupLabel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel) + return object; + var message = new $root.google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a GroupLabel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel + * @static + * @param {google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel} message GroupLabel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupLabel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this GroupLabel to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel + * @instance + * @returns {Object.} JSON object + */ + GroupLabel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupLabel + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupLabel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel"; + }; + + return GroupLabel; + })(); + + return PatchInstanceFilter; + })(); + + v1.PatchRollout = (function() { + + /** + * Properties of a PatchRollout. + * @memberof google.cloud.osconfig.v1 + * @interface IPatchRollout + * @property {google.cloud.osconfig.v1.PatchRollout.Mode|null} [mode] PatchRollout mode + * @property {google.cloud.osconfig.v1.IFixedOrPercent|null} [disruptionBudget] PatchRollout disruptionBudget + */ + + /** + * Constructs a new PatchRollout. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a PatchRollout. + * @implements IPatchRollout + * @constructor + * @param {google.cloud.osconfig.v1.IPatchRollout=} [properties] Properties to set + */ + function PatchRollout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchRollout mode. + * @member {google.cloud.osconfig.v1.PatchRollout.Mode} mode + * @memberof google.cloud.osconfig.v1.PatchRollout + * @instance + */ + PatchRollout.prototype.mode = 0; + + /** + * PatchRollout disruptionBudget. + * @member {google.cloud.osconfig.v1.IFixedOrPercent|null|undefined} disruptionBudget + * @memberof google.cloud.osconfig.v1.PatchRollout + * @instance + */ + PatchRollout.prototype.disruptionBudget = null; + + /** + * Creates a new PatchRollout instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.PatchRollout + * @static + * @param {google.cloud.osconfig.v1.IPatchRollout=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.PatchRollout} PatchRollout instance + */ + PatchRollout.create = function create(properties) { + return new PatchRollout(properties); + }; + + /** + * Encodes the specified PatchRollout message. Does not implicitly {@link google.cloud.osconfig.v1.PatchRollout.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.PatchRollout + * @static + * @param {google.cloud.osconfig.v1.IPatchRollout} message PatchRollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRollout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + if (message.disruptionBudget != null && Object.hasOwnProperty.call(message, "disruptionBudget")) + $root.google.cloud.osconfig.v1.FixedOrPercent.encode(message.disruptionBudget, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchRollout message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.PatchRollout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.PatchRollout + * @static + * @param {google.cloud.osconfig.v1.IPatchRollout} message PatchRollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRollout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchRollout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.PatchRollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.PatchRollout} PatchRollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRollout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.PatchRollout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + case 2: { + message.disruptionBudget = $root.google.cloud.osconfig.v1.FixedOrPercent.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchRollout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.PatchRollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.PatchRollout} PatchRollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRollout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchRollout message. + * @function verify + * @memberof google.cloud.osconfig.v1.PatchRollout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchRollout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.disruptionBudget != null && message.hasOwnProperty("disruptionBudget")) { + var error = $root.google.cloud.osconfig.v1.FixedOrPercent.verify(message.disruptionBudget); + if (error) + return "disruptionBudget." + error; + } + return null; + }; + + /** + * Creates a PatchRollout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.PatchRollout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.PatchRollout} PatchRollout + */ + PatchRollout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.PatchRollout) + return object; + var message = new $root.google.cloud.osconfig.v1.PatchRollout(); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "ZONE_BY_ZONE": + case 1: + message.mode = 1; + break; + case "CONCURRENT_ZONES": + case 2: + message.mode = 2; + break; + } + if (object.disruptionBudget != null) { + if (typeof object.disruptionBudget !== "object") + throw TypeError(".google.cloud.osconfig.v1.PatchRollout.disruptionBudget: object expected"); + message.disruptionBudget = $root.google.cloud.osconfig.v1.FixedOrPercent.fromObject(object.disruptionBudget); + } + return message; + }; + + /** + * Creates a plain object from a PatchRollout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.PatchRollout + * @static + * @param {google.cloud.osconfig.v1.PatchRollout} message PatchRollout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchRollout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + object.disruptionBudget = null; + } + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.osconfig.v1.PatchRollout.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.osconfig.v1.PatchRollout.Mode[message.mode] : message.mode; + if (message.disruptionBudget != null && message.hasOwnProperty("disruptionBudget")) + object.disruptionBudget = $root.google.cloud.osconfig.v1.FixedOrPercent.toObject(message.disruptionBudget, options); + return object; + }; + + /** + * Converts this PatchRollout to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.PatchRollout + * @instance + * @returns {Object.} JSON object + */ + PatchRollout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PatchRollout + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.PatchRollout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PatchRollout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.PatchRollout"; + }; + + /** + * Mode enum. + * @name google.cloud.osconfig.v1.PatchRollout.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} ZONE_BY_ZONE=1 ZONE_BY_ZONE value + * @property {number} CONCURRENT_ZONES=2 CONCURRENT_ZONES value + */ + PatchRollout.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONE_BY_ZONE"] = 1; + values[valuesById[2] = "CONCURRENT_ZONES"] = 2; + return values; + })(); + + return PatchRollout; + })(); + + v1.OsConfigZonalService = (function() { + + /** + * Constructs a new OsConfigZonalService service. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an OsConfigZonalService + * @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 OsConfigZonalService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (OsConfigZonalService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = OsConfigZonalService; + + /** + * Creates new OsConfigZonalService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @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 {OsConfigZonalService} RPC service. Useful where requests and/or responses are streamed. + */ + OsConfigZonalService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|createOSPolicyAssignment}. + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @typedef CreateOSPolicyAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateOSPolicyAssignment. + * @function createOSPolicyAssignment + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest} request CreateOSPolicyAssignmentRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigZonalService.CreateOSPolicyAssignmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.createOSPolicyAssignment = function createOSPolicyAssignment(request, callback) { + return this.rpcCall(createOSPolicyAssignment, $root.google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateOSPolicyAssignment" }); + + /** + * Calls CreateOSPolicyAssignment. + * @function createOSPolicyAssignment + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest} request CreateOSPolicyAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|updateOSPolicyAssignment}. + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @typedef UpdateOSPolicyAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateOSPolicyAssignment. + * @function updateOSPolicyAssignment + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest} request UpdateOSPolicyAssignmentRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigZonalService.UpdateOSPolicyAssignmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.updateOSPolicyAssignment = function updateOSPolicyAssignment(request, callback) { + return this.rpcCall(updateOSPolicyAssignment, $root.google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateOSPolicyAssignment" }); + + /** + * Calls UpdateOSPolicyAssignment. + * @function updateOSPolicyAssignment + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest} request UpdateOSPolicyAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|getOSPolicyAssignment}. + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @typedef GetOSPolicyAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.OSPolicyAssignment} [response] OSPolicyAssignment + */ + + /** + * Calls GetOSPolicyAssignment. + * @function getOSPolicyAssignment + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest} request GetOSPolicyAssignmentRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigZonalService.GetOSPolicyAssignmentCallback} callback Node-style callback called with the error, if any, and OSPolicyAssignment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.getOSPolicyAssignment = function getOSPolicyAssignment(request, callback) { + return this.rpcCall(getOSPolicyAssignment, $root.google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest, $root.google.cloud.osconfig.v1.OSPolicyAssignment, request, callback); + }, "name", { value: "GetOSPolicyAssignment" }); + + /** + * Calls GetOSPolicyAssignment. + * @function getOSPolicyAssignment + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest} request GetOSPolicyAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|listOSPolicyAssignments}. + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @typedef ListOSPolicyAssignmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse} [response] ListOSPolicyAssignmentsResponse + */ + + /** + * Calls ListOSPolicyAssignments. + * @function listOSPolicyAssignments + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest} request ListOSPolicyAssignmentsRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigZonalService.ListOSPolicyAssignmentsCallback} callback Node-style callback called with the error, if any, and ListOSPolicyAssignmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.listOSPolicyAssignments = function listOSPolicyAssignments(request, callback) { + return this.rpcCall(listOSPolicyAssignments, $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest, $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse, request, callback); + }, "name", { value: "ListOSPolicyAssignments" }); + + /** + * Calls ListOSPolicyAssignments. + * @function listOSPolicyAssignments + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest} request ListOSPolicyAssignmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|listOSPolicyAssignmentRevisions}. + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @typedef ListOSPolicyAssignmentRevisionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse} [response] ListOSPolicyAssignmentRevisionsResponse + */ + + /** + * Calls ListOSPolicyAssignmentRevisions. + * @function listOSPolicyAssignmentRevisions + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest} request ListOSPolicyAssignmentRevisionsRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigZonalService.ListOSPolicyAssignmentRevisionsCallback} callback Node-style callback called with the error, if any, and ListOSPolicyAssignmentRevisionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.listOSPolicyAssignmentRevisions = function listOSPolicyAssignmentRevisions(request, callback) { + return this.rpcCall(listOSPolicyAssignmentRevisions, $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest, $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse, request, callback); + }, "name", { value: "ListOSPolicyAssignmentRevisions" }); + + /** + * Calls ListOSPolicyAssignmentRevisions. + * @function listOSPolicyAssignmentRevisions + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest} request ListOSPolicyAssignmentRevisionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|deleteOSPolicyAssignment}. + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @typedef DeleteOSPolicyAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteOSPolicyAssignment. + * @function deleteOSPolicyAssignment + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest} request DeleteOSPolicyAssignmentRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigZonalService.DeleteOSPolicyAssignmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.deleteOSPolicyAssignment = function deleteOSPolicyAssignment(request, callback) { + return this.rpcCall(deleteOSPolicyAssignment, $root.google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteOSPolicyAssignment" }); + + /** + * Calls DeleteOSPolicyAssignment. + * @function deleteOSPolicyAssignment + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest} request DeleteOSPolicyAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|getOSPolicyAssignmentReport}. + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @typedef GetOSPolicyAssignmentReportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.OSPolicyAssignmentReport} [response] OSPolicyAssignmentReport + */ + + /** + * Calls GetOSPolicyAssignmentReport. + * @function getOSPolicyAssignmentReport + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest} request GetOSPolicyAssignmentReportRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigZonalService.GetOSPolicyAssignmentReportCallback} callback Node-style callback called with the error, if any, and OSPolicyAssignmentReport + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.getOSPolicyAssignmentReport = function getOSPolicyAssignmentReport(request, callback) { + return this.rpcCall(getOSPolicyAssignmentReport, $root.google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest, $root.google.cloud.osconfig.v1.OSPolicyAssignmentReport, request, callback); + }, "name", { value: "GetOSPolicyAssignmentReport" }); + + /** + * Calls GetOSPolicyAssignmentReport. + * @function getOSPolicyAssignmentReport + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest} request GetOSPolicyAssignmentReportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|listOSPolicyAssignmentReports}. + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @typedef ListOSPolicyAssignmentReportsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse} [response] ListOSPolicyAssignmentReportsResponse + */ + + /** + * Calls ListOSPolicyAssignmentReports. + * @function listOSPolicyAssignmentReports + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest} request ListOSPolicyAssignmentReportsRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigZonalService.ListOSPolicyAssignmentReportsCallback} callback Node-style callback called with the error, if any, and ListOSPolicyAssignmentReportsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.listOSPolicyAssignmentReports = function listOSPolicyAssignmentReports(request, callback) { + return this.rpcCall(listOSPolicyAssignmentReports, $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest, $root.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse, request, callback); + }, "name", { value: "ListOSPolicyAssignmentReports" }); + + /** + * Calls ListOSPolicyAssignmentReports. + * @function listOSPolicyAssignmentReports + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest} request ListOSPolicyAssignmentReportsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|getInventory}. + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @typedef GetInventoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.Inventory} [response] Inventory + */ + + /** + * Calls GetInventory. + * @function getInventory + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IGetInventoryRequest} request GetInventoryRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigZonalService.GetInventoryCallback} callback Node-style callback called with the error, if any, and Inventory + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.getInventory = function getInventory(request, callback) { + return this.rpcCall(getInventory, $root.google.cloud.osconfig.v1.GetInventoryRequest, $root.google.cloud.osconfig.v1.Inventory, request, callback); + }, "name", { value: "GetInventory" }); + + /** + * Calls GetInventory. + * @function getInventory + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IGetInventoryRequest} request GetInventoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|listInventories}. + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @typedef ListInventoriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.ListInventoriesResponse} [response] ListInventoriesResponse + */ + + /** + * Calls ListInventories. + * @function listInventories + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IListInventoriesRequest} request ListInventoriesRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigZonalService.ListInventoriesCallback} callback Node-style callback called with the error, if any, and ListInventoriesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.listInventories = function listInventories(request, callback) { + return this.rpcCall(listInventories, $root.google.cloud.osconfig.v1.ListInventoriesRequest, $root.google.cloud.osconfig.v1.ListInventoriesResponse, request, callback); + }, "name", { value: "ListInventories" }); + + /** + * Calls ListInventories. + * @function listInventories + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IListInventoriesRequest} request ListInventoriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|getVulnerabilityReport}. + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @typedef GetVulnerabilityReportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.VulnerabilityReport} [response] VulnerabilityReport + */ + + /** + * Calls GetVulnerabilityReport. + * @function getVulnerabilityReport + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IGetVulnerabilityReportRequest} request GetVulnerabilityReportRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigZonalService.GetVulnerabilityReportCallback} callback Node-style callback called with the error, if any, and VulnerabilityReport + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.getVulnerabilityReport = function getVulnerabilityReport(request, callback) { + return this.rpcCall(getVulnerabilityReport, $root.google.cloud.osconfig.v1.GetVulnerabilityReportRequest, $root.google.cloud.osconfig.v1.VulnerabilityReport, request, callback); + }, "name", { value: "GetVulnerabilityReport" }); + + /** + * Calls GetVulnerabilityReport. + * @function getVulnerabilityReport + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IGetVulnerabilityReportRequest} request GetVulnerabilityReportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1.OsConfigZonalService|listVulnerabilityReports}. + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @typedef ListVulnerabilityReportsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1.ListVulnerabilityReportsResponse} [response] ListVulnerabilityReportsResponse + */ + + /** + * Calls ListVulnerabilityReports. + * @function listVulnerabilityReports + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IListVulnerabilityReportsRequest} request ListVulnerabilityReportsRequest message or plain object + * @param {google.cloud.osconfig.v1.OsConfigZonalService.ListVulnerabilityReportsCallback} callback Node-style callback called with the error, if any, and ListVulnerabilityReportsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.listVulnerabilityReports = function listVulnerabilityReports(request, callback) { + return this.rpcCall(listVulnerabilityReports, $root.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest, $root.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse, request, callback); + }, "name", { value: "ListVulnerabilityReports" }); + + /** + * Calls ListVulnerabilityReports. + * @function listVulnerabilityReports + * @memberof google.cloud.osconfig.v1.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1.IListVulnerabilityReportsRequest} request ListVulnerabilityReportsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return OsConfigZonalService; + })(); + + v1.VulnerabilityReport = (function() { + + /** + * Properties of a VulnerabilityReport. + * @memberof google.cloud.osconfig.v1 + * @interface IVulnerabilityReport + * @property {string|null} [name] VulnerabilityReport name + * @property {Array.|null} [vulnerabilities] VulnerabilityReport vulnerabilities + * @property {google.protobuf.ITimestamp|null} [updateTime] VulnerabilityReport updateTime + */ + + /** + * Constructs a new VulnerabilityReport. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a VulnerabilityReport. + * @implements IVulnerabilityReport + * @constructor + * @param {google.cloud.osconfig.v1.IVulnerabilityReport=} [properties] Properties to set + */ + function VulnerabilityReport(properties) { + this.vulnerabilities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VulnerabilityReport name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @instance + */ + VulnerabilityReport.prototype.name = ""; + + /** + * VulnerabilityReport vulnerabilities. + * @member {Array.} vulnerabilities + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @instance + */ + VulnerabilityReport.prototype.vulnerabilities = $util.emptyArray; + + /** + * VulnerabilityReport updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @instance + */ + VulnerabilityReport.prototype.updateTime = null; + + /** + * Creates a new VulnerabilityReport instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @static + * @param {google.cloud.osconfig.v1.IVulnerabilityReport=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.VulnerabilityReport} VulnerabilityReport instance + */ + VulnerabilityReport.create = function create(properties) { + return new VulnerabilityReport(properties); + }; + + /** + * Encodes the specified VulnerabilityReport message. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @static + * @param {google.cloud.osconfig.v1.IVulnerabilityReport} message VulnerabilityReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerabilityReport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.vulnerabilities != null && message.vulnerabilities.length) + for (var i = 0; i < message.vulnerabilities.length; ++i) + $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.encode(message.vulnerabilities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VulnerabilityReport message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @static + * @param {google.cloud.osconfig.v1.IVulnerabilityReport} message VulnerabilityReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerabilityReport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VulnerabilityReport message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.VulnerabilityReport} VulnerabilityReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerabilityReport.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.VulnerabilityReport(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.vulnerabilities && message.vulnerabilities.length)) + message.vulnerabilities = []; + message.vulnerabilities.push($root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.decode(reader, reader.uint32())); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VulnerabilityReport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.VulnerabilityReport} VulnerabilityReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerabilityReport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VulnerabilityReport message. + * @function verify + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VulnerabilityReport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.vulnerabilities != null && message.hasOwnProperty("vulnerabilities")) { + if (!Array.isArray(message.vulnerabilities)) + return "vulnerabilities: array expected"; + for (var i = 0; i < message.vulnerabilities.length; ++i) { + var error = $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.verify(message.vulnerabilities[i]); + if (error) + return "vulnerabilities." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a VulnerabilityReport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.VulnerabilityReport} VulnerabilityReport + */ + VulnerabilityReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.VulnerabilityReport) + return object; + var message = new $root.google.cloud.osconfig.v1.VulnerabilityReport(); + if (object.name != null) + message.name = String(object.name); + if (object.vulnerabilities) { + if (!Array.isArray(object.vulnerabilities)) + throw TypeError(".google.cloud.osconfig.v1.VulnerabilityReport.vulnerabilities: array expected"); + message.vulnerabilities = []; + for (var i = 0; i < object.vulnerabilities.length; ++i) { + if (typeof object.vulnerabilities[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.VulnerabilityReport.vulnerabilities: object expected"); + message.vulnerabilities[i] = $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.fromObject(object.vulnerabilities[i]); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.VulnerabilityReport.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a VulnerabilityReport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport} message VulnerabilityReport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VulnerabilityReport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vulnerabilities = []; + if (options.defaults) { + object.name = ""; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.vulnerabilities && message.vulnerabilities.length) { + object.vulnerabilities = []; + for (var j = 0; j < message.vulnerabilities.length; ++j) + object.vulnerabilities[j] = $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.toObject(message.vulnerabilities[j], options); + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this VulnerabilityReport to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @instance + * @returns {Object.} JSON object + */ + VulnerabilityReport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VulnerabilityReport + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VulnerabilityReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.VulnerabilityReport"; + }; + + VulnerabilityReport.Vulnerability = (function() { + + /** + * Properties of a Vulnerability. + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @interface IVulnerability + * @property {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IDetails|null} [details] Vulnerability details + * @property {Array.|null} [installedInventoryItemIds] Vulnerability installedInventoryItemIds + * @property {Array.|null} [availableInventoryItemIds] Vulnerability availableInventoryItemIds + * @property {google.protobuf.ITimestamp|null} [createTime] Vulnerability createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Vulnerability updateTime + * @property {Array.|null} [items] Vulnerability items + */ + + /** + * Constructs a new Vulnerability. + * @memberof google.cloud.osconfig.v1.VulnerabilityReport + * @classdesc Represents a Vulnerability. + * @implements IVulnerability + * @constructor + * @param {google.cloud.osconfig.v1.VulnerabilityReport.IVulnerability=} [properties] Properties to set + */ + function Vulnerability(properties) { + this.installedInventoryItemIds = []; + this.availableInventoryItemIds = []; + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Vulnerability details. + * @member {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IDetails|null|undefined} details + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @instance + */ + Vulnerability.prototype.details = null; + + /** + * Vulnerability installedInventoryItemIds. + * @member {Array.} installedInventoryItemIds + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @instance + */ + Vulnerability.prototype.installedInventoryItemIds = $util.emptyArray; + + /** + * Vulnerability availableInventoryItemIds. + * @member {Array.} availableInventoryItemIds + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @instance + */ + Vulnerability.prototype.availableInventoryItemIds = $util.emptyArray; + + /** + * Vulnerability createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @instance + */ + Vulnerability.prototype.createTime = null; + + /** + * Vulnerability updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @instance + */ + Vulnerability.prototype.updateTime = null; + + /** + * Vulnerability items. + * @member {Array.} items + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @instance + */ + Vulnerability.prototype.items = $util.emptyArray; + + /** + * Creates a new Vulnerability instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.IVulnerability=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability} Vulnerability instance + */ + Vulnerability.create = function create(properties) { + return new Vulnerability(properties); + }; + + /** + * Encodes the specified Vulnerability message. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.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.details != null && Object.hasOwnProperty.call(message, "details")) + $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.encode(message.details, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.installedInventoryItemIds != null && message.installedInventoryItemIds.length) + for (var i = 0; i < message.installedInventoryItemIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.installedInventoryItemIds[i]); + if (message.availableInventoryItemIds != null && message.availableInventoryItemIds.length) + for (var i = 0; i < message.availableInventoryItemIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.availableInventoryItemIds[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item.encode(message.items[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Vulnerability message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.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.osconfig.v1.VulnerabilityReport.Vulnerability + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.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.osconfig.v1.VulnerabilityReport.Vulnerability(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.details = $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.installedInventoryItemIds && message.installedInventoryItemIds.length)) + message.installedInventoryItemIds = []; + message.installedInventoryItemIds.push(reader.string()); + break; + } + case 3: { + if (!(message.availableInventoryItemIds && message.availableInventoryItemIds.length)) + message.availableInventoryItemIds = []; + message.availableInventoryItemIds.push(reader.string()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item.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.osconfig.v1.VulnerabilityReport.Vulnerability + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.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.osconfig.v1.VulnerabilityReport.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.details != null && message.hasOwnProperty("details")) { + var error = $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.verify(message.details); + if (error) + return "details." + error; + } + if (message.installedInventoryItemIds != null && message.hasOwnProperty("installedInventoryItemIds")) { + if (!Array.isArray(message.installedInventoryItemIds)) + return "installedInventoryItemIds: array expected"; + for (var i = 0; i < message.installedInventoryItemIds.length; ++i) + if (!$util.isString(message.installedInventoryItemIds[i])) + return "installedInventoryItemIds: string[] expected"; + } + if (message.availableInventoryItemIds != null && message.hasOwnProperty("availableInventoryItemIds")) { + if (!Array.isArray(message.availableInventoryItemIds)) + return "availableInventoryItemIds: array expected"; + for (var i = 0; i < message.availableInventoryItemIds.length; ++i) + if (!$util.isString(message.availableInventoryItemIds[i])) + return "availableInventoryItemIds: 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.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates a Vulnerability message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability} Vulnerability + */ + Vulnerability.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability) + return object; + var message = new $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability(); + if (object.details != null) { + if (typeof object.details !== "object") + throw TypeError(".google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.details: object expected"); + message.details = $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.fromObject(object.details); + } + if (object.installedInventoryItemIds) { + if (!Array.isArray(object.installedInventoryItemIds)) + throw TypeError(".google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.installedInventoryItemIds: array expected"); + message.installedInventoryItemIds = []; + for (var i = 0; i < object.installedInventoryItemIds.length; ++i) + message.installedInventoryItemIds[i] = String(object.installedInventoryItemIds[i]); + } + if (object.availableInventoryItemIds) { + if (!Array.isArray(object.availableInventoryItemIds)) + throw TypeError(".google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.availableInventoryItemIds: array expected"); + message.availableInventoryItemIds = []; + for (var i = 0; i < object.availableInventoryItemIds.length; ++i) + message.availableInventoryItemIds[i] = String(object.availableInventoryItemIds[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.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.osconfig.v1.VulnerabilityReport.Vulnerability.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.items: object expected"); + message.items[i] = $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Vulnerability message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.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.arrays || options.defaults) { + object.installedInventoryItemIds = []; + object.availableInventoryItemIds = []; + object.items = []; + } + if (options.defaults) { + object.details = null; + object.createTime = null; + object.updateTime = null; + } + if (message.details != null && message.hasOwnProperty("details")) + object.details = $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.toObject(message.details, options); + if (message.installedInventoryItemIds && message.installedInventoryItemIds.length) { + object.installedInventoryItemIds = []; + for (var j = 0; j < message.installedInventoryItemIds.length; ++j) + object.installedInventoryItemIds[j] = message.installedInventoryItemIds[j]; + } + if (message.availableInventoryItemIds && message.availableInventoryItemIds.length) { + object.availableInventoryItemIds = []; + for (var j = 0; j < message.availableInventoryItemIds.length; ++j) + object.availableInventoryItemIds[j] = message.availableInventoryItemIds[j]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this Vulnerability to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.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.osconfig.v1.VulnerabilityReport.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.osconfig.v1.VulnerabilityReport.Vulnerability"; + }; + + Vulnerability.Details = (function() { + + /** + * Properties of a Details. + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @interface IDetails + * @property {string|null} [cve] Details cve + * @property {number|null} [cvssV2Score] Details cvssV2Score + * @property {google.cloud.osconfig.v1.ICVSSv3|null} [cvssV3] Details cvssV3 + * @property {string|null} [severity] Details severity + * @property {string|null} [description] Details description + * @property {Array.|null} [references] Details references + */ + + /** + * Constructs a new Details. + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @classdesc Represents a Details. + * @implements IDetails + * @constructor + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IDetails=} [properties] Properties to set + */ + function Details(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]]; + } + + /** + * Details cve. + * @member {string} cve + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @instance + */ + Details.prototype.cve = ""; + + /** + * Details cvssV2Score. + * @member {number} cvssV2Score + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @instance + */ + Details.prototype.cvssV2Score = 0; + + /** + * Details cvssV3. + * @member {google.cloud.osconfig.v1.ICVSSv3|null|undefined} cvssV3 + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @instance + */ + Details.prototype.cvssV3 = null; + + /** + * Details severity. + * @member {string} severity + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @instance + */ + Details.prototype.severity = ""; + + /** + * Details description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @instance + */ + Details.prototype.description = ""; + + /** + * Details references. + * @member {Array.} references + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @instance + */ + Details.prototype.references = $util.emptyArray; + + /** + * Creates a new Details instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IDetails=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details} Details instance + */ + Details.create = function create(properties) { + return new Details(properties); + }; + + /** + * Encodes the specified Details message. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IDetails} message Details message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Details.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cve != null && Object.hasOwnProperty.call(message, "cve")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cve); + if (message.cvssV2Score != null && Object.hasOwnProperty.call(message, "cvssV2Score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.cvssV2Score); + if (message.cvssV3 != null && Object.hasOwnProperty.call(message, "cvssV3")) + $root.google.cloud.osconfig.v1.CVSSv3.encode(message.cvssV3, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.severity); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.references != null && message.references.length) + for (var i = 0; i < message.references.length; ++i) + $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference.encode(message.references[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Details message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IDetails} message Details message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Details.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Details message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details} Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Details.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cve = reader.string(); + break; + } + case 2: { + message.cvssV2Score = reader.float(); + break; + } + case 3: { + message.cvssV3 = $root.google.cloud.osconfig.v1.CVSSv3.decode(reader, reader.uint32()); + break; + } + case 4: { + message.severity = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + if (!(message.references && message.references.length)) + message.references = []; + message.references.push($root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Details message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details} Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Details.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Details message. + * @function verify + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Details.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cve != null && message.hasOwnProperty("cve")) + if (!$util.isString(message.cve)) + return "cve: string expected"; + if (message.cvssV2Score != null && message.hasOwnProperty("cvssV2Score")) + if (typeof message.cvssV2Score !== "number") + return "cvssV2Score: number expected"; + if (message.cvssV3 != null && message.hasOwnProperty("cvssV3")) { + var error = $root.google.cloud.osconfig.v1.CVSSv3.verify(message.cvssV3); + if (error) + return "cvssV3." + error; + } + if (message.severity != null && message.hasOwnProperty("severity")) + if (!$util.isString(message.severity)) + return "severity: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference.verify(message.references[i]); + if (error) + return "references." + error; + } + } + return null; + }; + + /** + * Creates a Details message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details} Details + */ + Details.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details) + return object; + var message = new $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details(); + if (object.cve != null) + message.cve = String(object.cve); + if (object.cvssV2Score != null) + message.cvssV2Score = Number(object.cvssV2Score); + if (object.cvssV3 != null) { + if (typeof object.cvssV3 !== "object") + throw TypeError(".google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.cvssV3: object expected"); + message.cvssV3 = $root.google.cloud.osconfig.v1.CVSSv3.fromObject(object.cvssV3); + } + if (object.severity != null) + message.severity = String(object.severity); + if (object.description != null) + message.description = String(object.description); + if (object.references) { + if (!Array.isArray(object.references)) + throw TypeError(".google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.references: array expected"); + message.references = []; + for (var i = 0; i < object.references.length; ++i) { + if (typeof object.references[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.references: object expected"); + message.references[i] = $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference.fromObject(object.references[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Details message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details} message Details + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Details.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.references = []; + if (options.defaults) { + object.cve = ""; + object.cvssV2Score = 0; + object.cvssV3 = null; + object.severity = ""; + object.description = ""; + } + if (message.cve != null && message.hasOwnProperty("cve")) + object.cve = message.cve; + if (message.cvssV2Score != null && message.hasOwnProperty("cvssV2Score")) + object.cvssV2Score = options.json && !isFinite(message.cvssV2Score) ? String(message.cvssV2Score) : message.cvssV2Score; + if (message.cvssV3 != null && message.hasOwnProperty("cvssV3")) + object.cvssV3 = $root.google.cloud.osconfig.v1.CVSSv3.toObject(message.cvssV3, options); + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = message.severity; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.references && message.references.length) { + object.references = []; + for (var j = 0; j < message.references.length; ++j) + object.references[j] = $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference.toObject(message.references[j], options); + } + return object; + }; + + /** + * Converts this Details to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @instance + * @returns {Object.} JSON object + */ + Details.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Details + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Details.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details"; + }; + + Details.Reference = (function() { + + /** + * Properties of a Reference. + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @interface IReference + * @property {string|null} [url] Reference url + * @property {string|null} [source] Reference source + */ + + /** + * Constructs a new Reference. + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + * @classdesc Represents a Reference. + * @implements IReference + * @constructor + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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 url. + * @member {string} url + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + * @instance + */ + Reference.prototype.url = ""; + + /** + * Reference source. + * @member {string} source + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + * @instance + */ + Reference.prototype.source = ""; + + /** + * Creates a new Reference instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.IReference=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference} Reference instance + */ + Reference.create = function create(properties) { + return new Reference(properties); + }; + + /** + * Encodes the specified Reference message. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.source); + return writer; + }; + + /** + * Encodes the specified Reference message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.url = reader.string(); + break; + } + case 2: { + message.source = 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference} Reference + */ + Reference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference) + return object; + var message = new $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference(); + if (object.url != null) + message.url = String(object.url); + if (object.source != null) + message.source = String(object.source); + return message; + }; + + /** + * Creates a plain object from a Reference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.url = ""; + object.source = ""; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + return object; + }; + + /** + * Converts this Reference to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference"; + }; + + return Reference; + })(); + + return Details; + })(); + + Vulnerability.Item = (function() { + + /** + * Properties of an Item. + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @interface IItem + * @property {string|null} [installedInventoryItemId] Item installedInventoryItemId + * @property {string|null} [availableInventoryItemId] Item availableInventoryItemId + * @property {string|null} [fixedCpeUri] Item fixedCpeUri + * @property {string|null} [upstreamFix] Item upstreamFix + */ + + /** + * Constructs a new Item. + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + * @classdesc Represents an Item. + * @implements IItem + * @constructor + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IItem=} [properties] Properties to set + */ + function Item(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Item installedInventoryItemId. + * @member {string} installedInventoryItemId + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @instance + */ + Item.prototype.installedInventoryItemId = ""; + + /** + * Item availableInventoryItemId. + * @member {string} availableInventoryItemId + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @instance + */ + Item.prototype.availableInventoryItemId = ""; + + /** + * Item fixedCpeUri. + * @member {string} fixedCpeUri + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @instance + */ + Item.prototype.fixedCpeUri = ""; + + /** + * Item upstreamFix. + * @member {string} upstreamFix + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @instance + */ + Item.prototype.upstreamFix = ""; + + /** + * Creates a new Item instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IItem=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item} Item instance + */ + Item.create = function create(properties) { + return new Item(properties); + }; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.installedInventoryItemId != null && Object.hasOwnProperty.call(message, "installedInventoryItemId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.installedInventoryItemId); + if (message.availableInventoryItemId != null && Object.hasOwnProperty.call(message, "availableInventoryItemId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.availableInventoryItemId); + if (message.fixedCpeUri != null && Object.hasOwnProperty.call(message, "fixedCpeUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fixedCpeUri); + if (message.upstreamFix != null && Object.hasOwnProperty.call(message, "upstreamFix")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.upstreamFix); + return writer; + }; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Item message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.installedInventoryItemId = reader.string(); + break; + } + case 2: { + message.availableInventoryItemId = reader.string(); + break; + } + case 3: { + message.fixedCpeUri = reader.string(); + break; + } + case 4: { + message.upstreamFix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Item message. + * @function verify + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Item.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.installedInventoryItemId != null && message.hasOwnProperty("installedInventoryItemId")) + if (!$util.isString(message.installedInventoryItemId)) + return "installedInventoryItemId: string expected"; + if (message.availableInventoryItemId != null && message.hasOwnProperty("availableInventoryItemId")) + if (!$util.isString(message.availableInventoryItemId)) + return "availableInventoryItemId: string expected"; + if (message.fixedCpeUri != null && message.hasOwnProperty("fixedCpeUri")) + if (!$util.isString(message.fixedCpeUri)) + return "fixedCpeUri: string expected"; + if (message.upstreamFix != null && message.hasOwnProperty("upstreamFix")) + if (!$util.isString(message.upstreamFix)) + return "upstreamFix: string expected"; + return null; + }; + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item} Item + */ + Item.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item) + return object; + var message = new $root.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item(); + if (object.installedInventoryItemId != null) + message.installedInventoryItemId = String(object.installedInventoryItemId); + if (object.availableInventoryItemId != null) + message.availableInventoryItemId = String(object.availableInventoryItemId); + if (object.fixedCpeUri != null) + message.fixedCpeUri = String(object.fixedCpeUri); + if (object.upstreamFix != null) + message.upstreamFix = String(object.upstreamFix); + return message; + }; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @static + * @param {google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item} message Item + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Item.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.installedInventoryItemId = ""; + object.availableInventoryItemId = ""; + object.fixedCpeUri = ""; + object.upstreamFix = ""; + } + if (message.installedInventoryItemId != null && message.hasOwnProperty("installedInventoryItemId")) + object.installedInventoryItemId = message.installedInventoryItemId; + if (message.availableInventoryItemId != null && message.hasOwnProperty("availableInventoryItemId")) + object.availableInventoryItemId = message.availableInventoryItemId; + if (message.fixedCpeUri != null && message.hasOwnProperty("fixedCpeUri")) + object.fixedCpeUri = message.fixedCpeUri; + if (message.upstreamFix != null && message.hasOwnProperty("upstreamFix")) + object.upstreamFix = message.upstreamFix; + return object; + }; + + /** + * Converts this Item to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @instance + * @returns {Object.} JSON object + */ + Item.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Item + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Item.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Item"; + }; + + return Item; + })(); + + return Vulnerability; + })(); + + return VulnerabilityReport; + })(); + + v1.GetVulnerabilityReportRequest = (function() { + + /** + * Properties of a GetVulnerabilityReportRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IGetVulnerabilityReportRequest + * @property {string|null} [name] GetVulnerabilityReportRequest name + */ + + /** + * Constructs a new GetVulnerabilityReportRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a GetVulnerabilityReportRequest. + * @implements IGetVulnerabilityReportRequest + * @constructor + * @param {google.cloud.osconfig.v1.IGetVulnerabilityReportRequest=} [properties] Properties to set + */ + function GetVulnerabilityReportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVulnerabilityReportRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.GetVulnerabilityReportRequest + * @instance + */ + GetVulnerabilityReportRequest.prototype.name = ""; + + /** + * Creates a new GetVulnerabilityReportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.GetVulnerabilityReportRequest + * @static + * @param {google.cloud.osconfig.v1.IGetVulnerabilityReportRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.GetVulnerabilityReportRequest} GetVulnerabilityReportRequest instance + */ + GetVulnerabilityReportRequest.create = function create(properties) { + return new GetVulnerabilityReportRequest(properties); + }; + + /** + * Encodes the specified GetVulnerabilityReportRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetVulnerabilityReportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.GetVulnerabilityReportRequest + * @static + * @param {google.cloud.osconfig.v1.IGetVulnerabilityReportRequest} message GetVulnerabilityReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVulnerabilityReportRequest.encode = function encode(message, writer) { + 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 GetVulnerabilityReportRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetVulnerabilityReportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.GetVulnerabilityReportRequest + * @static + * @param {google.cloud.osconfig.v1.IGetVulnerabilityReportRequest} message GetVulnerabilityReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVulnerabilityReportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVulnerabilityReportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.GetVulnerabilityReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.GetVulnerabilityReportRequest} GetVulnerabilityReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVulnerabilityReportRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.GetVulnerabilityReportRequest(); + 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 GetVulnerabilityReportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.GetVulnerabilityReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.GetVulnerabilityReportRequest} GetVulnerabilityReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVulnerabilityReportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVulnerabilityReportRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.GetVulnerabilityReportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVulnerabilityReportRequest.verify = function verify(message) { + if (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 GetVulnerabilityReportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.GetVulnerabilityReportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.GetVulnerabilityReportRequest} GetVulnerabilityReportRequest + */ + GetVulnerabilityReportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.GetVulnerabilityReportRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.GetVulnerabilityReportRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetVulnerabilityReportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.GetVulnerabilityReportRequest + * @static + * @param {google.cloud.osconfig.v1.GetVulnerabilityReportRequest} message GetVulnerabilityReportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVulnerabilityReportRequest.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 GetVulnerabilityReportRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.GetVulnerabilityReportRequest + * @instance + * @returns {Object.} JSON object + */ + GetVulnerabilityReportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetVulnerabilityReportRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.GetVulnerabilityReportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetVulnerabilityReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.GetVulnerabilityReportRequest"; + }; + + return GetVulnerabilityReportRequest; + })(); + + v1.ListVulnerabilityReportsRequest = (function() { + + /** + * Properties of a ListVulnerabilityReportsRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IListVulnerabilityReportsRequest + * @property {string|null} [parent] ListVulnerabilityReportsRequest parent + * @property {number|null} [pageSize] ListVulnerabilityReportsRequest pageSize + * @property {string|null} [pageToken] ListVulnerabilityReportsRequest pageToken + * @property {string|null} [filter] ListVulnerabilityReportsRequest filter + */ + + /** + * Constructs a new ListVulnerabilityReportsRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListVulnerabilityReportsRequest. + * @implements IListVulnerabilityReportsRequest + * @constructor + * @param {google.cloud.osconfig.v1.IListVulnerabilityReportsRequest=} [properties] Properties to set + */ + function ListVulnerabilityReportsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVulnerabilityReportsRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @instance + */ + ListVulnerabilityReportsRequest.prototype.parent = ""; + + /** + * ListVulnerabilityReportsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @instance + */ + ListVulnerabilityReportsRequest.prototype.pageSize = 0; + + /** + * ListVulnerabilityReportsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @instance + */ + ListVulnerabilityReportsRequest.prototype.pageToken = ""; + + /** + * ListVulnerabilityReportsRequest filter. + * @member {string} filter + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @instance + */ + ListVulnerabilityReportsRequest.prototype.filter = ""; + + /** + * Creates a new ListVulnerabilityReportsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @static + * @param {google.cloud.osconfig.v1.IListVulnerabilityReportsRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListVulnerabilityReportsRequest} ListVulnerabilityReportsRequest instance + */ + ListVulnerabilityReportsRequest.create = function create(properties) { + return new ListVulnerabilityReportsRequest(properties); + }; + + /** + * Encodes the specified ListVulnerabilityReportsRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListVulnerabilityReportsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @static + * @param {google.cloud.osconfig.v1.IListVulnerabilityReportsRequest} message ListVulnerabilityReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVulnerabilityReportsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListVulnerabilityReportsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListVulnerabilityReportsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @static + * @param {google.cloud.osconfig.v1.IListVulnerabilityReportsRequest} message ListVulnerabilityReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVulnerabilityReportsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVulnerabilityReportsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListVulnerabilityReportsRequest} ListVulnerabilityReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVulnerabilityReportsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVulnerabilityReportsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListVulnerabilityReportsRequest} ListVulnerabilityReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVulnerabilityReportsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVulnerabilityReportsRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVulnerabilityReportsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListVulnerabilityReportsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListVulnerabilityReportsRequest} ListVulnerabilityReportsRequest + */ + ListVulnerabilityReportsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListVulnerabilityReportsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @static + * @param {google.cloud.osconfig.v1.ListVulnerabilityReportsRequest} message ListVulnerabilityReportsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVulnerabilityReportsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListVulnerabilityReportsRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @instance + * @returns {Object.} JSON object + */ + ListVulnerabilityReportsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVulnerabilityReportsRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVulnerabilityReportsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListVulnerabilityReportsRequest"; + }; + + return ListVulnerabilityReportsRequest; + })(); + + v1.ListVulnerabilityReportsResponse = (function() { + + /** + * Properties of a ListVulnerabilityReportsResponse. + * @memberof google.cloud.osconfig.v1 + * @interface IListVulnerabilityReportsResponse + * @property {Array.|null} [vulnerabilityReports] ListVulnerabilityReportsResponse vulnerabilityReports + * @property {string|null} [nextPageToken] ListVulnerabilityReportsResponse nextPageToken + */ + + /** + * Constructs a new ListVulnerabilityReportsResponse. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListVulnerabilityReportsResponse. + * @implements IListVulnerabilityReportsResponse + * @constructor + * @param {google.cloud.osconfig.v1.IListVulnerabilityReportsResponse=} [properties] Properties to set + */ + function ListVulnerabilityReportsResponse(properties) { + this.vulnerabilityReports = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVulnerabilityReportsResponse vulnerabilityReports. + * @member {Array.} vulnerabilityReports + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + * @instance + */ + ListVulnerabilityReportsResponse.prototype.vulnerabilityReports = $util.emptyArray; + + /** + * ListVulnerabilityReportsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + * @instance + */ + ListVulnerabilityReportsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListVulnerabilityReportsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + * @static + * @param {google.cloud.osconfig.v1.IListVulnerabilityReportsResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListVulnerabilityReportsResponse} ListVulnerabilityReportsResponse instance + */ + ListVulnerabilityReportsResponse.create = function create(properties) { + return new ListVulnerabilityReportsResponse(properties); + }; + + /** + * Encodes the specified ListVulnerabilityReportsResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + * @static + * @param {google.cloud.osconfig.v1.IListVulnerabilityReportsResponse} message ListVulnerabilityReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVulnerabilityReportsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vulnerabilityReports != null && message.vulnerabilityReports.length) + for (var i = 0; i < message.vulnerabilityReports.length; ++i) + $root.google.cloud.osconfig.v1.VulnerabilityReport.encode(message.vulnerabilityReports[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 ListVulnerabilityReportsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + * @static + * @param {google.cloud.osconfig.v1.IListVulnerabilityReportsResponse} message ListVulnerabilityReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVulnerabilityReportsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVulnerabilityReportsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListVulnerabilityReportsResponse} ListVulnerabilityReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVulnerabilityReportsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.vulnerabilityReports && message.vulnerabilityReports.length)) + message.vulnerabilityReports = []; + message.vulnerabilityReports.push($root.google.cloud.osconfig.v1.VulnerabilityReport.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVulnerabilityReportsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListVulnerabilityReportsResponse} ListVulnerabilityReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVulnerabilityReportsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVulnerabilityReportsResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVulnerabilityReportsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vulnerabilityReports != null && message.hasOwnProperty("vulnerabilityReports")) { + if (!Array.isArray(message.vulnerabilityReports)) + return "vulnerabilityReports: array expected"; + for (var i = 0; i < message.vulnerabilityReports.length; ++i) { + var error = $root.google.cloud.osconfig.v1.VulnerabilityReport.verify(message.vulnerabilityReports[i]); + if (error) + return "vulnerabilityReports." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListVulnerabilityReportsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListVulnerabilityReportsResponse} ListVulnerabilityReportsResponse + */ + ListVulnerabilityReportsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse) + return object; + var message = new $root.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse(); + if (object.vulnerabilityReports) { + if (!Array.isArray(object.vulnerabilityReports)) + throw TypeError(".google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.vulnerabilityReports: array expected"); + message.vulnerabilityReports = []; + for (var i = 0; i < object.vulnerabilityReports.length; ++i) { + if (typeof object.vulnerabilityReports[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.vulnerabilityReports: object expected"); + message.vulnerabilityReports[i] = $root.google.cloud.osconfig.v1.VulnerabilityReport.fromObject(object.vulnerabilityReports[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListVulnerabilityReportsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + * @static + * @param {google.cloud.osconfig.v1.ListVulnerabilityReportsResponse} message ListVulnerabilityReportsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVulnerabilityReportsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vulnerabilityReports = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.vulnerabilityReports && message.vulnerabilityReports.length) { + object.vulnerabilityReports = []; + for (var j = 0; j < message.vulnerabilityReports.length; ++j) + object.vulnerabilityReports[j] = $root.google.cloud.osconfig.v1.VulnerabilityReport.toObject(message.vulnerabilityReports[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListVulnerabilityReportsResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + * @instance + * @returns {Object.} JSON object + */ + ListVulnerabilityReportsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVulnerabilityReportsResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVulnerabilityReportsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListVulnerabilityReportsResponse"; + }; + + return ListVulnerabilityReportsResponse; + })(); + + v1.CVSSv3 = (function() { + + /** + * Properties of a CVSSv3. + * @memberof google.cloud.osconfig.v1 + * @interface ICVSSv3 + * @property {number|null} [baseScore] CVSSv3 baseScore + * @property {number|null} [exploitabilityScore] CVSSv3 exploitabilityScore + * @property {number|null} [impactScore] CVSSv3 impactScore + * @property {google.cloud.osconfig.v1.CVSSv3.AttackVector|null} [attackVector] CVSSv3 attackVector + * @property {google.cloud.osconfig.v1.CVSSv3.AttackComplexity|null} [attackComplexity] CVSSv3 attackComplexity + * @property {google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired|null} [privilegesRequired] CVSSv3 privilegesRequired + * @property {google.cloud.osconfig.v1.CVSSv3.UserInteraction|null} [userInteraction] CVSSv3 userInteraction + * @property {google.cloud.osconfig.v1.CVSSv3.Scope|null} [scope] CVSSv3 scope + * @property {google.cloud.osconfig.v1.CVSSv3.Impact|null} [confidentialityImpact] CVSSv3 confidentialityImpact + * @property {google.cloud.osconfig.v1.CVSSv3.Impact|null} [integrityImpact] CVSSv3 integrityImpact + * @property {google.cloud.osconfig.v1.CVSSv3.Impact|null} [availabilityImpact] CVSSv3 availabilityImpact + */ + + /** + * Constructs a new CVSSv3. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a CVSSv3. + * @implements ICVSSv3 + * @constructor + * @param {google.cloud.osconfig.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.osconfig.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.baseScore = 0; + + /** + * CVSSv3 exploitabilityScore. + * @member {number} exploitabilityScore + * @memberof google.cloud.osconfig.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.exploitabilityScore = 0; + + /** + * CVSSv3 impactScore. + * @member {number} impactScore + * @memberof google.cloud.osconfig.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.impactScore = 0; + + /** + * CVSSv3 attackVector. + * @member {google.cloud.osconfig.v1.CVSSv3.AttackVector} attackVector + * @memberof google.cloud.osconfig.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.attackVector = 0; + + /** + * CVSSv3 attackComplexity. + * @member {google.cloud.osconfig.v1.CVSSv3.AttackComplexity} attackComplexity + * @memberof google.cloud.osconfig.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.attackComplexity = 0; + + /** + * CVSSv3 privilegesRequired. + * @member {google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired} privilegesRequired + * @memberof google.cloud.osconfig.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.privilegesRequired = 0; + + /** + * CVSSv3 userInteraction. + * @member {google.cloud.osconfig.v1.CVSSv3.UserInteraction} userInteraction + * @memberof google.cloud.osconfig.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.userInteraction = 0; + + /** + * CVSSv3 scope. + * @member {google.cloud.osconfig.v1.CVSSv3.Scope} scope + * @memberof google.cloud.osconfig.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.scope = 0; + + /** + * CVSSv3 confidentialityImpact. + * @member {google.cloud.osconfig.v1.CVSSv3.Impact} confidentialityImpact + * @memberof google.cloud.osconfig.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.confidentialityImpact = 0; + + /** + * CVSSv3 integrityImpact. + * @member {google.cloud.osconfig.v1.CVSSv3.Impact} integrityImpact + * @memberof google.cloud.osconfig.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.integrityImpact = 0; + + /** + * CVSSv3 availabilityImpact. + * @member {google.cloud.osconfig.v1.CVSSv3.Impact} availabilityImpact + * @memberof google.cloud.osconfig.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.availabilityImpact = 0; + + /** + * Creates a new CVSSv3 instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.CVSSv3 + * @static + * @param {google.cloud.osconfig.v1.ICVSSv3=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.CVSSv3} CVSSv3 instance + */ + CVSSv3.create = function create(properties) { + return new CVSSv3(properties); + }; + + /** + * Encodes the specified CVSSv3 message. Does not implicitly {@link google.cloud.osconfig.v1.CVSSv3.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.CVSSv3 + * @static + * @param {google.cloud.osconfig.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 5 =*/13).float(message.baseScore); + if (message.exploitabilityScore != null && Object.hasOwnProperty.call(message, "exploitabilityScore")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.exploitabilityScore); + if (message.impactScore != null && Object.hasOwnProperty.call(message, "impactScore")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.impactScore); + 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.osconfig.v1.CVSSv3.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.CVSSv3 + * @static + * @param {google.cloud.osconfig.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.osconfig.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.osconfig.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.osconfig.v1.CVSSv3(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseScore = reader.float(); + break; + } + case 2: { + message.exploitabilityScore = reader.float(); + break; + } + case 3: { + message.impactScore = reader.float(); + 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.osconfig.v1.CVSSv3 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.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.osconfig.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.exploitabilityScore != null && message.hasOwnProperty("exploitabilityScore")) + if (typeof message.exploitabilityScore !== "number") + return "exploitabilityScore: number expected"; + if (message.impactScore != null && message.hasOwnProperty("impactScore")) + if (typeof message.impactScore !== "number") + return "impactScore: 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.osconfig.v1.CVSSv3 + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.CVSSv3} CVSSv3 + */ + CVSSv3.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.CVSSv3) + return object; + var message = new $root.google.cloud.osconfig.v1.CVSSv3(); + if (object.baseScore != null) + message.baseScore = Number(object.baseScore); + if (object.exploitabilityScore != null) + message.exploitabilityScore = Number(object.exploitabilityScore); + if (object.impactScore != null) + message.impactScore = Number(object.impactScore); + 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.osconfig.v1.CVSSv3 + * @static + * @param {google.cloud.osconfig.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.exploitabilityScore = 0; + object.impactScore = 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.exploitabilityScore != null && message.hasOwnProperty("exploitabilityScore")) + object.exploitabilityScore = options.json && !isFinite(message.exploitabilityScore) ? String(message.exploitabilityScore) : message.exploitabilityScore; + if (message.impactScore != null && message.hasOwnProperty("impactScore")) + object.impactScore = options.json && !isFinite(message.impactScore) ? String(message.impactScore) : message.impactScore; + if (message.attackVector != null && message.hasOwnProperty("attackVector")) + object.attackVector = options.enums === String ? $root.google.cloud.osconfig.v1.CVSSv3.AttackVector[message.attackVector] === undefined ? message.attackVector : $root.google.cloud.osconfig.v1.CVSSv3.AttackVector[message.attackVector] : message.attackVector; + if (message.attackComplexity != null && message.hasOwnProperty("attackComplexity")) + object.attackComplexity = options.enums === String ? $root.google.cloud.osconfig.v1.CVSSv3.AttackComplexity[message.attackComplexity] === undefined ? message.attackComplexity : $root.google.cloud.osconfig.v1.CVSSv3.AttackComplexity[message.attackComplexity] : message.attackComplexity; + if (message.privilegesRequired != null && message.hasOwnProperty("privilegesRequired")) + object.privilegesRequired = options.enums === String ? $root.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired[message.privilegesRequired] === undefined ? message.privilegesRequired : $root.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired[message.privilegesRequired] : message.privilegesRequired; + if (message.userInteraction != null && message.hasOwnProperty("userInteraction")) + object.userInteraction = options.enums === String ? $root.google.cloud.osconfig.v1.CVSSv3.UserInteraction[message.userInteraction] === undefined ? message.userInteraction : $root.google.cloud.osconfig.v1.CVSSv3.UserInteraction[message.userInteraction] : message.userInteraction; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.osconfig.v1.CVSSv3.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.osconfig.v1.CVSSv3.Scope[message.scope] : message.scope; + if (message.confidentialityImpact != null && message.hasOwnProperty("confidentialityImpact")) + object.confidentialityImpact = options.enums === String ? $root.google.cloud.osconfig.v1.CVSSv3.Impact[message.confidentialityImpact] === undefined ? message.confidentialityImpact : $root.google.cloud.osconfig.v1.CVSSv3.Impact[message.confidentialityImpact] : message.confidentialityImpact; + if (message.integrityImpact != null && message.hasOwnProperty("integrityImpact")) + object.integrityImpact = options.enums === String ? $root.google.cloud.osconfig.v1.CVSSv3.Impact[message.integrityImpact] === undefined ? message.integrityImpact : $root.google.cloud.osconfig.v1.CVSSv3.Impact[message.integrityImpact] : message.integrityImpact; + if (message.availabilityImpact != null && message.hasOwnProperty("availabilityImpact")) + object.availabilityImpact = options.enums === String ? $root.google.cloud.osconfig.v1.CVSSv3.Impact[message.availabilityImpact] === undefined ? message.availabilityImpact : $root.google.cloud.osconfig.v1.CVSSv3.Impact[message.availabilityImpact] : message.availabilityImpact; + return object; + }; + + /** + * Converts this CVSSv3 to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.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.osconfig.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.osconfig.v1.CVSSv3"; + }; + + /** + * AttackVector enum. + * @name google.cloud.osconfig.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.osconfig.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.osconfig.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.osconfig.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.osconfig.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.osconfig.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; + })(); + + return v1; + })(); + + osconfig.v1alpha = (function() { + + /** + * Namespace v1alpha. + * @memberof google.cloud.osconfig + * @namespace + */ + var v1alpha = {}; + + v1alpha.OSPolicyResourceConfigStep = (function() { + + /** + * Properties of a OSPolicyResourceConfigStep. + * @memberof google.cloud.osconfig.v1alpha + * @interface IOSPolicyResourceConfigStep + * @property {google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Type|null} [type] OSPolicyResourceConfigStep type + * @property {google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Outcome|null} [outcome] OSPolicyResourceConfigStep outcome + * @property {string|null} [errorMessage] OSPolicyResourceConfigStep errorMessage + */ + + /** + * Constructs a new OSPolicyResourceConfigStep. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a OSPolicyResourceConfigStep. + * @implements IOSPolicyResourceConfigStep + * @constructor + * @param {google.cloud.osconfig.v1alpha.IOSPolicyResourceConfigStep=} [properties] Properties to set + */ + function OSPolicyResourceConfigStep(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyResourceConfigStep type. + * @member {google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Type} type + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep + * @instance + */ + OSPolicyResourceConfigStep.prototype.type = 0; + + /** + * OSPolicyResourceConfigStep outcome. + * @member {google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Outcome} outcome + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep + * @instance + */ + OSPolicyResourceConfigStep.prototype.outcome = 0; + + /** + * OSPolicyResourceConfigStep errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep + * @instance + */ + OSPolicyResourceConfigStep.prototype.errorMessage = ""; + + /** + * Creates a new OSPolicyResourceConfigStep instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyResourceConfigStep=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep} OSPolicyResourceConfigStep instance + */ + OSPolicyResourceConfigStep.create = function create(properties) { + return new OSPolicyResourceConfigStep(properties); + }; + + /** + * Encodes the specified OSPolicyResourceConfigStep message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyResourceConfigStep} message OSPolicyResourceConfigStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyResourceConfigStep.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.outcome); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessage); + return writer; + }; + + /** + * Encodes the specified OSPolicyResourceConfigStep message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyResourceConfigStep} message OSPolicyResourceConfigStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyResourceConfigStep.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyResourceConfigStep message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep} OSPolicyResourceConfigStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyResourceConfigStep.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.outcome = reader.int32(); + break; + } + case 3: { + message.errorMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyResourceConfigStep message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep} OSPolicyResourceConfigStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyResourceConfigStep.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyResourceConfigStep message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyResourceConfigStep.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + return null; + }; + + /** + * Creates a OSPolicyResourceConfigStep message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep} OSPolicyResourceConfigStep + */ + OSPolicyResourceConfigStep.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "VALIDATION": + case 1: + message.type = 1; + break; + case "DESIRED_STATE_CHECK": + case 2: + message.type = 2; + break; + case "DESIRED_STATE_ENFORCEMENT": + case 3: + message.type = 3; + break; + case "DESIRED_STATE_CHECK_POST_ENFORCEMENT": + case 4: + message.type = 4; + break; + } + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "SUCCEEDED": + case 1: + message.outcome = 1; + break; + case "FAILED": + case 2: + message.outcome = 2; + break; + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + return message; + }; + + /** + * Creates a plain object from a OSPolicyResourceConfigStep message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep} message OSPolicyResourceConfigStep + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyResourceConfigStep.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + object.errorMessage = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Type[message.type] === undefined ? message.type : $root.google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Type[message.type] : message.type; + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Outcome[message.outcome] : message.outcome; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + return object; + }; + + /** + * Converts this OSPolicyResourceConfigStep to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep + * @instance + * @returns {Object.} JSON object + */ + OSPolicyResourceConfigStep.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyResourceConfigStep + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyResourceConfigStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep"; + }; + + /** + * Type enum. + * @name google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} VALIDATION=1 VALIDATION value + * @property {number} DESIRED_STATE_CHECK=2 DESIRED_STATE_CHECK value + * @property {number} DESIRED_STATE_ENFORCEMENT=3 DESIRED_STATE_ENFORCEMENT value + * @property {number} DESIRED_STATE_CHECK_POST_ENFORCEMENT=4 DESIRED_STATE_CHECK_POST_ENFORCEMENT value + */ + OSPolicyResourceConfigStep.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VALIDATION"] = 1; + values[valuesById[2] = "DESIRED_STATE_CHECK"] = 2; + values[valuesById[3] = "DESIRED_STATE_ENFORCEMENT"] = 3; + values[valuesById[4] = "DESIRED_STATE_CHECK_POST_ENFORCEMENT"] = 4; + return values; + })(); + + /** + * Outcome enum. + * @name google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.Outcome + * @enum {number} + * @property {number} OUTCOME_UNSPECIFIED=0 OUTCOME_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + */ + OSPolicyResourceConfigStep.Outcome = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OUTCOME_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + return values; + })(); + + return OSPolicyResourceConfigStep; + })(); + + v1alpha.OSPolicyResourceCompliance = (function() { + + /** + * Properties of a OSPolicyResourceCompliance. + * @memberof google.cloud.osconfig.v1alpha + * @interface IOSPolicyResourceCompliance + * @property {string|null} [osPolicyResourceId] OSPolicyResourceCompliance osPolicyResourceId + * @property {Array.|null} [configSteps] OSPolicyResourceCompliance configSteps + * @property {google.cloud.osconfig.v1alpha.OSPolicyComplianceState|null} [state] OSPolicyResourceCompliance state + * @property {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.IExecResourceOutput|null} [execResourceOutput] OSPolicyResourceCompliance execResourceOutput + */ + + /** + * Constructs a new OSPolicyResourceCompliance. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a OSPolicyResourceCompliance. + * @implements IOSPolicyResourceCompliance + * @constructor + * @param {google.cloud.osconfig.v1alpha.IOSPolicyResourceCompliance=} [properties] Properties to set + */ + function OSPolicyResourceCompliance(properties) { + this.configSteps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyResourceCompliance osPolicyResourceId. + * @member {string} osPolicyResourceId + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.osPolicyResourceId = ""; + + /** + * OSPolicyResourceCompliance configSteps. + * @member {Array.} configSteps + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.configSteps = $util.emptyArray; + + /** + * OSPolicyResourceCompliance state. + * @member {google.cloud.osconfig.v1alpha.OSPolicyComplianceState} state + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.state = 0; + + /** + * OSPolicyResourceCompliance execResourceOutput. + * @member {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.IExecResourceOutput|null|undefined} execResourceOutput + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.execResourceOutput = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OSPolicyResourceCompliance output. + * @member {"execResourceOutput"|undefined} output + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @instance + */ + Object.defineProperty(OSPolicyResourceCompliance.prototype, "output", { + get: $util.oneOfGetter($oneOfFields = ["execResourceOutput"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OSPolicyResourceCompliance instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyResourceCompliance=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance} OSPolicyResourceCompliance instance + */ + OSPolicyResourceCompliance.create = function create(properties) { + return new OSPolicyResourceCompliance(properties); + }; + + /** + * Encodes the specified OSPolicyResourceCompliance message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyResourceCompliance} message OSPolicyResourceCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyResourceCompliance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyResourceId != null && Object.hasOwnProperty.call(message, "osPolicyResourceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.osPolicyResourceId); + if (message.configSteps != null && message.configSteps.length) + for (var i = 0; i < message.configSteps.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.encode(message.configSteps[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.execResourceOutput != null && Object.hasOwnProperty.call(message, "execResourceOutput")) + $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput.encode(message.execResourceOutput, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OSPolicyResourceCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyResourceCompliance} message OSPolicyResourceCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyResourceCompliance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyResourceCompliance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance} OSPolicyResourceCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyResourceCompliance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osPolicyResourceId = reader.string(); + break; + } + case 2: { + if (!(message.configSteps && message.configSteps.length)) + message.configSteps = []; + message.configSteps.push($root.google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.decode(reader, reader.uint32())); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.execResourceOutput = $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyResourceCompliance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance} OSPolicyResourceCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyResourceCompliance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyResourceCompliance message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyResourceCompliance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.osPolicyResourceId != null && message.hasOwnProperty("osPolicyResourceId")) + if (!$util.isString(message.osPolicyResourceId)) + return "osPolicyResourceId: string expected"; + if (message.configSteps != null && message.hasOwnProperty("configSteps")) { + if (!Array.isArray(message.configSteps)) + return "configSteps: array expected"; + for (var i = 0; i < message.configSteps.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.verify(message.configSteps[i]); + if (error) + return "configSteps." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.execResourceOutput != null && message.hasOwnProperty("execResourceOutput")) { + properties.output = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput.verify(message.execResourceOutput); + if (error) + return "execResourceOutput." + error; + } + } + return null; + }; + + /** + * Creates a OSPolicyResourceCompliance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance} OSPolicyResourceCompliance + */ + OSPolicyResourceCompliance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance(); + if (object.osPolicyResourceId != null) + message.osPolicyResourceId = String(object.osPolicyResourceId); + if (object.configSteps) { + if (!Array.isArray(object.configSteps)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.configSteps: array expected"); + message.configSteps = []; + for (var i = 0; i < object.configSteps.length; ++i) { + if (typeof object.configSteps[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.configSteps: object expected"); + message.configSteps[i] = $root.google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.fromObject(object.configSteps[i]); + } + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLIANT": + case 1: + message.state = 1; + break; + case "NON_COMPLIANT": + case 2: + message.state = 2; + break; + case "UNKNOWN": + case 3: + message.state = 3; + break; + case "NO_OS_POLICIES_APPLICABLE": + case 4: + message.state = 4; + break; + } + if (object.execResourceOutput != null) { + if (typeof object.execResourceOutput !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.execResourceOutput: object expected"); + message.execResourceOutput = $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput.fromObject(object.execResourceOutput); + } + return message; + }; + + /** + * Creates a plain object from a OSPolicyResourceCompliance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance} message OSPolicyResourceCompliance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyResourceCompliance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.configSteps = []; + if (options.defaults) { + object.osPolicyResourceId = ""; + object.state = options.enums === String ? "OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED" : 0; + } + if (message.osPolicyResourceId != null && message.hasOwnProperty("osPolicyResourceId")) + object.osPolicyResourceId = message.osPolicyResourceId; + if (message.configSteps && message.configSteps.length) { + object.configSteps = []; + for (var j = 0; j < message.configSteps.length; ++j) + object.configSteps[j] = $root.google.cloud.osconfig.v1alpha.OSPolicyResourceConfigStep.toObject(message.configSteps[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicyComplianceState[message.state] === undefined ? message.state : $root.google.cloud.osconfig.v1alpha.OSPolicyComplianceState[message.state] : message.state; + if (message.execResourceOutput != null && message.hasOwnProperty("execResourceOutput")) { + object.execResourceOutput = $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput.toObject(message.execResourceOutput, options); + if (options.oneofs) + object.output = "execResourceOutput"; + } + return object; + }; + + /** + * Converts this OSPolicyResourceCompliance to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @instance + * @returns {Object.} JSON object + */ + OSPolicyResourceCompliance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyResourceCompliance + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyResourceCompliance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance"; + }; + + OSPolicyResourceCompliance.ExecResourceOutput = (function() { + + /** + * Properties of an ExecResourceOutput. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @interface IExecResourceOutput + * @property {Uint8Array|null} [enforcementOutput] ExecResourceOutput enforcementOutput + */ + + /** + * Constructs a new ExecResourceOutput. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance + * @classdesc Represents an ExecResourceOutput. + * @implements IExecResourceOutput + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.IExecResourceOutput=} [properties] Properties to set + */ + function ExecResourceOutput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecResourceOutput enforcementOutput. + * @member {Uint8Array} enforcementOutput + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput + * @instance + */ + ExecResourceOutput.prototype.enforcementOutput = $util.newBuffer([]); + + /** + * Creates a new ExecResourceOutput instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.IExecResourceOutput=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput} ExecResourceOutput instance + */ + ExecResourceOutput.create = function create(properties) { + return new ExecResourceOutput(properties); + }; + + /** + * Encodes the specified ExecResourceOutput message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.IExecResourceOutput} message ExecResourceOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecResourceOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enforcementOutput != null && Object.hasOwnProperty.call(message, "enforcementOutput")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.enforcementOutput); + return writer; + }; + + /** + * Encodes the specified ExecResourceOutput message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.IExecResourceOutput} message ExecResourceOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecResourceOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecResourceOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput} ExecResourceOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecResourceOutput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.enforcementOutput = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecResourceOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput} ExecResourceOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecResourceOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecResourceOutput message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecResourceOutput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enforcementOutput != null && message.hasOwnProperty("enforcementOutput")) + if (!(message.enforcementOutput && typeof message.enforcementOutput.length === "number" || $util.isString(message.enforcementOutput))) + return "enforcementOutput: buffer expected"; + return null; + }; + + /** + * Creates an ExecResourceOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput} ExecResourceOutput + */ + ExecResourceOutput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput(); + if (object.enforcementOutput != null) + if (typeof object.enforcementOutput === "string") + $util.base64.decode(object.enforcementOutput, message.enforcementOutput = $util.newBuffer($util.base64.length(object.enforcementOutput)), 0); + else if (object.enforcementOutput.length >= 0) + message.enforcementOutput = object.enforcementOutput; + return message; + }; + + /** + * Creates a plain object from an ExecResourceOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput} message ExecResourceOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecResourceOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.enforcementOutput = ""; + else { + object.enforcementOutput = []; + if (options.bytes !== Array) + object.enforcementOutput = $util.newBuffer(object.enforcementOutput); + } + if (message.enforcementOutput != null && message.hasOwnProperty("enforcementOutput")) + object.enforcementOutput = options.bytes === String ? $util.base64.encode(message.enforcementOutput, 0, message.enforcementOutput.length) : options.bytes === Array ? Array.prototype.slice.call(message.enforcementOutput) : message.enforcementOutput; + return object; + }; + + /** + * Converts this ExecResourceOutput to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput + * @instance + * @returns {Object.} JSON object + */ + ExecResourceOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecResourceOutput + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecResourceOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.ExecResourceOutput"; + }; + + return ExecResourceOutput; + })(); + + return OSPolicyResourceCompliance; + })(); + + /** + * OSPolicyComplianceState enum. + * @name google.cloud.osconfig.v1alpha.OSPolicyComplianceState + * @enum {number} + * @property {number} OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED=0 OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED value + * @property {number} COMPLIANT=1 COMPLIANT value + * @property {number} NON_COMPLIANT=2 NON_COMPLIANT value + * @property {number} UNKNOWN=3 UNKNOWN value + * @property {number} NO_OS_POLICIES_APPLICABLE=4 NO_OS_POLICIES_APPLICABLE value + */ + v1alpha.OSPolicyComplianceState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPLIANT"] = 1; + values[valuesById[2] = "NON_COMPLIANT"] = 2; + values[valuesById[3] = "UNKNOWN"] = 3; + values[valuesById[4] = "NO_OS_POLICIES_APPLICABLE"] = 4; + return values; + })(); + + v1alpha.InstanceOSPoliciesCompliance = (function() { + + /** + * Properties of an InstanceOSPoliciesCompliance. + * @memberof google.cloud.osconfig.v1alpha + * @interface IInstanceOSPoliciesCompliance + * @property {string|null} [name] InstanceOSPoliciesCompliance name + * @property {string|null} [instance] InstanceOSPoliciesCompliance instance + * @property {google.cloud.osconfig.v1alpha.OSPolicyComplianceState|null} [state] InstanceOSPoliciesCompliance state + * @property {string|null} [detailedState] InstanceOSPoliciesCompliance detailedState + * @property {string|null} [detailedStateReason] InstanceOSPoliciesCompliance detailedStateReason + * @property {Array.|null} [osPolicyCompliances] InstanceOSPoliciesCompliance osPolicyCompliances + * @property {google.protobuf.ITimestamp|null} [lastComplianceCheckTime] InstanceOSPoliciesCompliance lastComplianceCheckTime + * @property {string|null} [lastComplianceRunId] InstanceOSPoliciesCompliance lastComplianceRunId + */ + + /** + * Constructs a new InstanceOSPoliciesCompliance. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents an InstanceOSPoliciesCompliance. + * @implements IInstanceOSPoliciesCompliance + * @constructor + * @param {google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance=} [properties] Properties to set + */ + function InstanceOSPoliciesCompliance(properties) { + this.osPolicyCompliances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceOSPoliciesCompliance name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @instance + */ + InstanceOSPoliciesCompliance.prototype.name = ""; + + /** + * InstanceOSPoliciesCompliance instance. + * @member {string} instance + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @instance + */ + InstanceOSPoliciesCompliance.prototype.instance = ""; + + /** + * InstanceOSPoliciesCompliance state. + * @member {google.cloud.osconfig.v1alpha.OSPolicyComplianceState} state + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @instance + */ + InstanceOSPoliciesCompliance.prototype.state = 0; + + /** + * InstanceOSPoliciesCompliance detailedState. + * @member {string} detailedState + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @instance + */ + InstanceOSPoliciesCompliance.prototype.detailedState = ""; + + /** + * InstanceOSPoliciesCompliance detailedStateReason. + * @member {string} detailedStateReason + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @instance + */ + InstanceOSPoliciesCompliance.prototype.detailedStateReason = ""; + + /** + * InstanceOSPoliciesCompliance osPolicyCompliances. + * @member {Array.} osPolicyCompliances + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @instance + */ + InstanceOSPoliciesCompliance.prototype.osPolicyCompliances = $util.emptyArray; + + /** + * InstanceOSPoliciesCompliance lastComplianceCheckTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastComplianceCheckTime + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @instance + */ + InstanceOSPoliciesCompliance.prototype.lastComplianceCheckTime = null; + + /** + * InstanceOSPoliciesCompliance lastComplianceRunId. + * @member {string} lastComplianceRunId + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @instance + */ + InstanceOSPoliciesCompliance.prototype.lastComplianceRunId = ""; + + /** + * Creates a new InstanceOSPoliciesCompliance instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance} InstanceOSPoliciesCompliance instance + */ + InstanceOSPoliciesCompliance.create = function create(properties) { + return new InstanceOSPoliciesCompliance(properties); + }; + + /** + * Encodes the specified InstanceOSPoliciesCompliance message. Does not implicitly {@link google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance} message InstanceOSPoliciesCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceOSPoliciesCompliance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instance); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.detailedState != null && Object.hasOwnProperty.call(message, "detailedState")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.detailedState); + if (message.detailedStateReason != null && Object.hasOwnProperty.call(message, "detailedStateReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.detailedStateReason); + if (message.osPolicyCompliances != null && message.osPolicyCompliances.length) + for (var i = 0; i < message.osPolicyCompliances.length; ++i) + $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance.encode(message.osPolicyCompliances[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.lastComplianceCheckTime != null && Object.hasOwnProperty.call(message, "lastComplianceCheckTime")) + $root.google.protobuf.Timestamp.encode(message.lastComplianceCheckTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.lastComplianceRunId != null && Object.hasOwnProperty.call(message, "lastComplianceRunId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.lastComplianceRunId); + return writer; + }; + + /** + * Encodes the specified InstanceOSPoliciesCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance} message InstanceOSPoliciesCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceOSPoliciesCompliance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceOSPoliciesCompliance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance} InstanceOSPoliciesCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceOSPoliciesCompliance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.instance = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.detailedState = reader.string(); + break; + } + case 5: { + message.detailedStateReason = reader.string(); + break; + } + case 6: { + if (!(message.osPolicyCompliances && message.osPolicyCompliances.length)) + message.osPolicyCompliances = []; + message.osPolicyCompliances.push($root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance.decode(reader, reader.uint32())); + break; + } + case 7: { + message.lastComplianceCheckTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.lastComplianceRunId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceOSPoliciesCompliance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance} InstanceOSPoliciesCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceOSPoliciesCompliance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceOSPoliciesCompliance message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceOSPoliciesCompliance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.detailedState != null && message.hasOwnProperty("detailedState")) + if (!$util.isString(message.detailedState)) + return "detailedState: string expected"; + if (message.detailedStateReason != null && message.hasOwnProperty("detailedStateReason")) + if (!$util.isString(message.detailedStateReason)) + return "detailedStateReason: string expected"; + if (message.osPolicyCompliances != null && message.hasOwnProperty("osPolicyCompliances")) { + if (!Array.isArray(message.osPolicyCompliances)) + return "osPolicyCompliances: array expected"; + for (var i = 0; i < message.osPolicyCompliances.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance.verify(message.osPolicyCompliances[i]); + if (error) + return "osPolicyCompliances." + error; + } + } + if (message.lastComplianceCheckTime != null && message.hasOwnProperty("lastComplianceCheckTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastComplianceCheckTime); + if (error) + return "lastComplianceCheckTime." + error; + } + if (message.lastComplianceRunId != null && message.hasOwnProperty("lastComplianceRunId")) + if (!$util.isString(message.lastComplianceRunId)) + return "lastComplianceRunId: string expected"; + return null; + }; + + /** + * Creates an InstanceOSPoliciesCompliance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance} InstanceOSPoliciesCompliance + */ + InstanceOSPoliciesCompliance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance(); + if (object.name != null) + message.name = String(object.name); + if (object.instance != null) + message.instance = String(object.instance); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLIANT": + case 1: + message.state = 1; + break; + case "NON_COMPLIANT": + case 2: + message.state = 2; + break; + case "UNKNOWN": + case 3: + message.state = 3; + break; + case "NO_OS_POLICIES_APPLICABLE": + case 4: + message.state = 4; + break; + } + if (object.detailedState != null) + message.detailedState = String(object.detailedState); + if (object.detailedStateReason != null) + message.detailedStateReason = String(object.detailedStateReason); + if (object.osPolicyCompliances) { + if (!Array.isArray(object.osPolicyCompliances)) + throw TypeError(".google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.osPolicyCompliances: array expected"); + message.osPolicyCompliances = []; + for (var i = 0; i < object.osPolicyCompliances.length; ++i) { + if (typeof object.osPolicyCompliances[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.osPolicyCompliances: object expected"); + message.osPolicyCompliances[i] = $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance.fromObject(object.osPolicyCompliances[i]); + } + } + if (object.lastComplianceCheckTime != null) { + if (typeof object.lastComplianceCheckTime !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.lastComplianceCheckTime: object expected"); + message.lastComplianceCheckTime = $root.google.protobuf.Timestamp.fromObject(object.lastComplianceCheckTime); + } + if (object.lastComplianceRunId != null) + message.lastComplianceRunId = String(object.lastComplianceRunId); + return message; + }; + + /** + * Creates a plain object from an InstanceOSPoliciesCompliance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance} message InstanceOSPoliciesCompliance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceOSPoliciesCompliance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicyCompliances = []; + if (options.defaults) { + object.name = ""; + object.instance = ""; + object.state = options.enums === String ? "OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED" : 0; + object.detailedState = ""; + object.detailedStateReason = ""; + object.lastComplianceCheckTime = null; + object.lastComplianceRunId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicyComplianceState[message.state] === undefined ? message.state : $root.google.cloud.osconfig.v1alpha.OSPolicyComplianceState[message.state] : message.state; + if (message.detailedState != null && message.hasOwnProperty("detailedState")) + object.detailedState = message.detailedState; + if (message.detailedStateReason != null && message.hasOwnProperty("detailedStateReason")) + object.detailedStateReason = message.detailedStateReason; + if (message.osPolicyCompliances && message.osPolicyCompliances.length) { + object.osPolicyCompliances = []; + for (var j = 0; j < message.osPolicyCompliances.length; ++j) + object.osPolicyCompliances[j] = $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance.toObject(message.osPolicyCompliances[j], options); + } + if (message.lastComplianceCheckTime != null && message.hasOwnProperty("lastComplianceCheckTime")) + object.lastComplianceCheckTime = $root.google.protobuf.Timestamp.toObject(message.lastComplianceCheckTime, options); + if (message.lastComplianceRunId != null && message.hasOwnProperty("lastComplianceRunId")) + object.lastComplianceRunId = message.lastComplianceRunId; + return object; + }; + + /** + * Converts this InstanceOSPoliciesCompliance to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @instance + * @returns {Object.} JSON object + */ + InstanceOSPoliciesCompliance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceOSPoliciesCompliance + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceOSPoliciesCompliance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance"; + }; + + InstanceOSPoliciesCompliance.OSPolicyCompliance = (function() { + + /** + * Properties of a OSPolicyCompliance. + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @interface IOSPolicyCompliance + * @property {string|null} [osPolicyId] OSPolicyCompliance osPolicyId + * @property {string|null} [osPolicyAssignment] OSPolicyCompliance osPolicyAssignment + * @property {google.cloud.osconfig.v1alpha.OSPolicyComplianceState|null} [state] OSPolicyCompliance state + * @property {Array.|null} [osPolicyResourceCompliances] OSPolicyCompliance osPolicyResourceCompliances + */ + + /** + * Constructs a new OSPolicyCompliance. + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + * @classdesc Represents a OSPolicyCompliance. + * @implements IOSPolicyCompliance + * @constructor + * @param {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.IOSPolicyCompliance=} [properties] Properties to set + */ + function OSPolicyCompliance(properties) { + this.osPolicyResourceCompliances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyCompliance osPolicyId. + * @member {string} osPolicyId + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @instance + */ + OSPolicyCompliance.prototype.osPolicyId = ""; + + /** + * OSPolicyCompliance osPolicyAssignment. + * @member {string} osPolicyAssignment + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @instance + */ + OSPolicyCompliance.prototype.osPolicyAssignment = ""; + + /** + * OSPolicyCompliance state. + * @member {google.cloud.osconfig.v1alpha.OSPolicyComplianceState} state + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @instance + */ + OSPolicyCompliance.prototype.state = 0; + + /** + * OSPolicyCompliance osPolicyResourceCompliances. + * @member {Array.} osPolicyResourceCompliances + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @instance + */ + OSPolicyCompliance.prototype.osPolicyResourceCompliances = $util.emptyArray; + + /** + * Creates a new OSPolicyCompliance instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.IOSPolicyCompliance=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance} OSPolicyCompliance instance + */ + OSPolicyCompliance.create = function create(properties) { + return new OSPolicyCompliance(properties); + }; + + /** + * Encodes the specified OSPolicyCompliance message. Does not implicitly {@link google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.IOSPolicyCompliance} message OSPolicyCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyCompliance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyId != null && Object.hasOwnProperty.call(message, "osPolicyId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.osPolicyId); + if (message.osPolicyAssignment != null && Object.hasOwnProperty.call(message, "osPolicyAssignment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.osPolicyAssignment); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.osPolicyResourceCompliances != null && message.osPolicyResourceCompliances.length) + for (var i = 0; i < message.osPolicyResourceCompliances.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.encode(message.osPolicyResourceCompliances[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OSPolicyCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.IOSPolicyCompliance} message OSPolicyCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyCompliance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyCompliance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance} OSPolicyCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyCompliance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osPolicyId = reader.string(); + break; + } + case 2: { + message.osPolicyAssignment = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + if (!(message.osPolicyResourceCompliances && message.osPolicyResourceCompliances.length)) + message.osPolicyResourceCompliances = []; + message.osPolicyResourceCompliances.push($root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyCompliance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance} OSPolicyCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyCompliance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyCompliance message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyCompliance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osPolicyId != null && message.hasOwnProperty("osPolicyId")) + if (!$util.isString(message.osPolicyId)) + return "osPolicyId: string expected"; + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + if (!$util.isString(message.osPolicyAssignment)) + return "osPolicyAssignment: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.osPolicyResourceCompliances != null && message.hasOwnProperty("osPolicyResourceCompliances")) { + if (!Array.isArray(message.osPolicyResourceCompliances)) + return "osPolicyResourceCompliances: array expected"; + for (var i = 0; i < message.osPolicyResourceCompliances.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.verify(message.osPolicyResourceCompliances[i]); + if (error) + return "osPolicyResourceCompliances." + error; + } + } + return null; + }; + + /** + * Creates a OSPolicyCompliance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance} OSPolicyCompliance + */ + OSPolicyCompliance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance(); + if (object.osPolicyId != null) + message.osPolicyId = String(object.osPolicyId); + if (object.osPolicyAssignment != null) + message.osPolicyAssignment = String(object.osPolicyAssignment); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLIANT": + case 1: + message.state = 1; + break; + case "NON_COMPLIANT": + case 2: + message.state = 2; + break; + case "UNKNOWN": + case 3: + message.state = 3; + break; + case "NO_OS_POLICIES_APPLICABLE": + case 4: + message.state = 4; + break; + } + if (object.osPolicyResourceCompliances) { + if (!Array.isArray(object.osPolicyResourceCompliances)) + throw TypeError(".google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance.osPolicyResourceCompliances: array expected"); + message.osPolicyResourceCompliances = []; + for (var i = 0; i < object.osPolicyResourceCompliances.length; ++i) { + if (typeof object.osPolicyResourceCompliances[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance.osPolicyResourceCompliances: object expected"); + message.osPolicyResourceCompliances[i] = $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.fromObject(object.osPolicyResourceCompliances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a OSPolicyCompliance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance} message OSPolicyCompliance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyCompliance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicyResourceCompliances = []; + if (options.defaults) { + object.osPolicyId = ""; + object.osPolicyAssignment = ""; + object.state = options.enums === String ? "OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED" : 0; + } + if (message.osPolicyId != null && message.hasOwnProperty("osPolicyId")) + object.osPolicyId = message.osPolicyId; + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + object.osPolicyAssignment = message.osPolicyAssignment; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicyComplianceState[message.state] === undefined ? message.state : $root.google.cloud.osconfig.v1alpha.OSPolicyComplianceState[message.state] : message.state; + if (message.osPolicyResourceCompliances && message.osPolicyResourceCompliances.length) { + object.osPolicyResourceCompliances = []; + for (var j = 0; j < message.osPolicyResourceCompliances.length; ++j) + object.osPolicyResourceCompliances[j] = $root.google.cloud.osconfig.v1alpha.OSPolicyResourceCompliance.toObject(message.osPolicyResourceCompliances[j], options); + } + return object; + }; + + /** + * Converts this OSPolicyCompliance to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @instance + * @returns {Object.} JSON object + */ + OSPolicyCompliance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyCompliance + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyCompliance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance"; + }; + + return OSPolicyCompliance; + })(); + + return InstanceOSPoliciesCompliance; + })(); + + v1alpha.GetInstanceOSPoliciesComplianceRequest = (function() { + + /** + * Properties of a GetInstanceOSPoliciesComplianceRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface IGetInstanceOSPoliciesComplianceRequest + * @property {string|null} [name] GetInstanceOSPoliciesComplianceRequest name + */ + + /** + * Constructs a new GetInstanceOSPoliciesComplianceRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a GetInstanceOSPoliciesComplianceRequest. + * @implements IGetInstanceOSPoliciesComplianceRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest=} [properties] Properties to set + */ + function GetInstanceOSPoliciesComplianceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceOSPoliciesComplianceRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest + * @instance + */ + GetInstanceOSPoliciesComplianceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceOSPoliciesComplianceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest} GetInstanceOSPoliciesComplianceRequest instance + */ + GetInstanceOSPoliciesComplianceRequest.create = function create(properties) { + return new GetInstanceOSPoliciesComplianceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceOSPoliciesComplianceRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest} message GetInstanceOSPoliciesComplianceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceOSPoliciesComplianceRequest.encode = function encode(message, writer) { + 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 GetInstanceOSPoliciesComplianceRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest} message GetInstanceOSPoliciesComplianceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceOSPoliciesComplianceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceOSPoliciesComplianceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest} GetInstanceOSPoliciesComplianceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceOSPoliciesComplianceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest(); + 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 GetInstanceOSPoliciesComplianceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest} GetInstanceOSPoliciesComplianceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceOSPoliciesComplianceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceOSPoliciesComplianceRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceOSPoliciesComplianceRequest.verify = function verify(message) { + if (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 GetInstanceOSPoliciesComplianceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest} GetInstanceOSPoliciesComplianceRequest + */ + GetInstanceOSPoliciesComplianceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceOSPoliciesComplianceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest + * @static + * @param {google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest} message GetInstanceOSPoliciesComplianceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceOSPoliciesComplianceRequest.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 GetInstanceOSPoliciesComplianceRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceOSPoliciesComplianceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceOSPoliciesComplianceRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceOSPoliciesComplianceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest"; + }; + + return GetInstanceOSPoliciesComplianceRequest; + })(); + + v1alpha.ListInstanceOSPoliciesCompliancesRequest = (function() { + + /** + * Properties of a ListInstanceOSPoliciesCompliancesRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface IListInstanceOSPoliciesCompliancesRequest + * @property {string|null} [parent] ListInstanceOSPoliciesCompliancesRequest parent + * @property {number|null} [pageSize] ListInstanceOSPoliciesCompliancesRequest pageSize + * @property {string|null} [pageToken] ListInstanceOSPoliciesCompliancesRequest pageToken + * @property {string|null} [filter] ListInstanceOSPoliciesCompliancesRequest filter + */ + + /** + * Constructs a new ListInstanceOSPoliciesCompliancesRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a ListInstanceOSPoliciesCompliancesRequest. + * @implements IListInstanceOSPoliciesCompliancesRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest=} [properties] Properties to set + */ + function ListInstanceOSPoliciesCompliancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstanceOSPoliciesCompliancesRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @instance + */ + ListInstanceOSPoliciesCompliancesRequest.prototype.parent = ""; + + /** + * ListInstanceOSPoliciesCompliancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @instance + */ + ListInstanceOSPoliciesCompliancesRequest.prototype.pageSize = 0; + + /** + * ListInstanceOSPoliciesCompliancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @instance + */ + ListInstanceOSPoliciesCompliancesRequest.prototype.pageToken = ""; + + /** + * ListInstanceOSPoliciesCompliancesRequest filter. + * @member {string} filter + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @instance + */ + ListInstanceOSPoliciesCompliancesRequest.prototype.filter = ""; + + /** + * Creates a new ListInstanceOSPoliciesCompliancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest} ListInstanceOSPoliciesCompliancesRequest instance + */ + ListInstanceOSPoliciesCompliancesRequest.create = function create(properties) { + return new ListInstanceOSPoliciesCompliancesRequest(properties); + }; + + /** + * Encodes the specified ListInstanceOSPoliciesCompliancesRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest} message ListInstanceOSPoliciesCompliancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceOSPoliciesCompliancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListInstanceOSPoliciesCompliancesRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest} message ListInstanceOSPoliciesCompliancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceOSPoliciesCompliancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstanceOSPoliciesCompliancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest} ListInstanceOSPoliciesCompliancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceOSPoliciesCompliancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstanceOSPoliciesCompliancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest} ListInstanceOSPoliciesCompliancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceOSPoliciesCompliancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstanceOSPoliciesCompliancesRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstanceOSPoliciesCompliancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListInstanceOSPoliciesCompliancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest} ListInstanceOSPoliciesCompliancesRequest + */ + ListInstanceOSPoliciesCompliancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListInstanceOSPoliciesCompliancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @static + * @param {google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest} message ListInstanceOSPoliciesCompliancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstanceOSPoliciesCompliancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListInstanceOSPoliciesCompliancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstanceOSPoliciesCompliancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstanceOSPoliciesCompliancesRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstanceOSPoliciesCompliancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest"; + }; + + return ListInstanceOSPoliciesCompliancesRequest; + })(); + + v1alpha.ListInstanceOSPoliciesCompliancesResponse = (function() { + + /** + * Properties of a ListInstanceOSPoliciesCompliancesResponse. + * @memberof google.cloud.osconfig.v1alpha + * @interface IListInstanceOSPoliciesCompliancesResponse + * @property {Array.|null} [instanceOsPoliciesCompliances] ListInstanceOSPoliciesCompliancesResponse instanceOsPoliciesCompliances + * @property {string|null} [nextPageToken] ListInstanceOSPoliciesCompliancesResponse nextPageToken + */ + + /** + * Constructs a new ListInstanceOSPoliciesCompliancesResponse. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a ListInstanceOSPoliciesCompliancesResponse. + * @implements IListInstanceOSPoliciesCompliancesResponse + * @constructor + * @param {google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse=} [properties] Properties to set + */ + function ListInstanceOSPoliciesCompliancesResponse(properties) { + this.instanceOsPoliciesCompliances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstanceOSPoliciesCompliancesResponse instanceOsPoliciesCompliances. + * @member {Array.} instanceOsPoliciesCompliances + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse + * @instance + */ + ListInstanceOSPoliciesCompliancesResponse.prototype.instanceOsPoliciesCompliances = $util.emptyArray; + + /** + * ListInstanceOSPoliciesCompliancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse + * @instance + */ + ListInstanceOSPoliciesCompliancesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInstanceOSPoliciesCompliancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse} ListInstanceOSPoliciesCompliancesResponse instance + */ + ListInstanceOSPoliciesCompliancesResponse.create = function create(properties) { + return new ListInstanceOSPoliciesCompliancesResponse(properties); + }; + + /** + * Encodes the specified ListInstanceOSPoliciesCompliancesResponse message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse} message ListInstanceOSPoliciesCompliancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceOSPoliciesCompliancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceOsPoliciesCompliances != null && message.instanceOsPoliciesCompliances.length) + for (var i = 0; i < message.instanceOsPoliciesCompliances.length; ++i) + $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.encode(message.instanceOsPoliciesCompliances[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 ListInstanceOSPoliciesCompliancesResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse} message ListInstanceOSPoliciesCompliancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceOSPoliciesCompliancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstanceOSPoliciesCompliancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse} ListInstanceOSPoliciesCompliancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceOSPoliciesCompliancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.instanceOsPoliciesCompliances && message.instanceOsPoliciesCompliances.length)) + message.instanceOsPoliciesCompliances = []; + message.instanceOsPoliciesCompliances.push($root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstanceOSPoliciesCompliancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse} ListInstanceOSPoliciesCompliancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceOSPoliciesCompliancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstanceOSPoliciesCompliancesResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstanceOSPoliciesCompliancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceOsPoliciesCompliances != null && message.hasOwnProperty("instanceOsPoliciesCompliances")) { + if (!Array.isArray(message.instanceOsPoliciesCompliances)) + return "instanceOsPoliciesCompliances: array expected"; + for (var i = 0; i < message.instanceOsPoliciesCompliances.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.verify(message.instanceOsPoliciesCompliances[i]); + if (error) + return "instanceOsPoliciesCompliances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstanceOSPoliciesCompliancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse} ListInstanceOSPoliciesCompliancesResponse + */ + ListInstanceOSPoliciesCompliancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse(); + if (object.instanceOsPoliciesCompliances) { + if (!Array.isArray(object.instanceOsPoliciesCompliances)) + throw TypeError(".google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse.instanceOsPoliciesCompliances: array expected"); + message.instanceOsPoliciesCompliances = []; + for (var i = 0; i < object.instanceOsPoliciesCompliances.length; ++i) { + if (typeof object.instanceOsPoliciesCompliances[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse.instanceOsPoliciesCompliances: object expected"); + message.instanceOsPoliciesCompliances[i] = $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.fromObject(object.instanceOsPoliciesCompliances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstanceOSPoliciesCompliancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse + * @static + * @param {google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse} message ListInstanceOSPoliciesCompliancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstanceOSPoliciesCompliancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instanceOsPoliciesCompliances = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.instanceOsPoliciesCompliances && message.instanceOsPoliciesCompliances.length) { + object.instanceOsPoliciesCompliances = []; + for (var j = 0; j < message.instanceOsPoliciesCompliances.length; ++j) + object.instanceOsPoliciesCompliances[j] = $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.toObject(message.instanceOsPoliciesCompliances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInstanceOSPoliciesCompliancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstanceOSPoliciesCompliancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstanceOSPoliciesCompliancesResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstanceOSPoliciesCompliancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse"; + }; + + return ListInstanceOSPoliciesCompliancesResponse; + })(); + + v1alpha.Inventory = (function() { + + /** + * Properties of an Inventory. + * @memberof google.cloud.osconfig.v1alpha + * @interface IInventory + * @property {string|null} [name] Inventory name + * @property {google.cloud.osconfig.v1alpha.Inventory.IOsInfo|null} [osInfo] Inventory osInfo + * @property {Object.|null} [items] Inventory items + * @property {google.protobuf.ITimestamp|null} [updateTime] Inventory updateTime + */ + + /** + * Constructs a new Inventory. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents an Inventory. + * @implements IInventory + * @constructor + * @param {google.cloud.osconfig.v1alpha.IInventory=} [properties] Properties to set + */ + function Inventory(properties) { + this.items = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Inventory name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @instance + */ + Inventory.prototype.name = ""; + + /** + * Inventory osInfo. + * @member {google.cloud.osconfig.v1alpha.Inventory.IOsInfo|null|undefined} osInfo + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @instance + */ + Inventory.prototype.osInfo = null; + + /** + * Inventory items. + * @member {Object.} items + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @instance + */ + Inventory.prototype.items = $util.emptyObject; + + /** + * Inventory updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @instance + */ + Inventory.prototype.updateTime = null; + + /** + * Creates a new Inventory instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @static + * @param {google.cloud.osconfig.v1alpha.IInventory=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.Inventory} Inventory instance + */ + Inventory.create = function create(properties) { + return new Inventory(properties); + }; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @static + * @param {google.cloud.osconfig.v1alpha.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osInfo != null && Object.hasOwnProperty.call(message, "osInfo")) + $root.google.cloud.osconfig.v1alpha.Inventory.OsInfo.encode(message.osInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.osconfig.v1alpha.Inventory.Item.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @static + * @param {google.cloud.osconfig.v1alpha.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.Inventory} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.Inventory(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.name = reader.string(); + break; + } + case 1: { + message.osInfo = $root.google.cloud.osconfig.v1alpha.Inventory.OsInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.items === $util.emptyObject) + message.items = {}; + 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.osconfig.v1alpha.Inventory.Item.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.Inventory} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Inventory message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Inventory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.osInfo != null && message.hasOwnProperty("osInfo")) { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.OsInfo.verify(message.osInfo); + if (error) + return "osInfo." + error; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.Item.verify(message.items[key[i]]); + if (error) + return "items." + 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 Inventory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.Inventory} Inventory + */ + Inventory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.Inventory) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.Inventory(); + if (object.name != null) + message.name = String(object.name); + if (object.osInfo != null) { + if (typeof object.osInfo !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.osInfo: object expected"); + message.osInfo = $root.google.cloud.osconfig.v1alpha.Inventory.OsInfo.fromObject(object.osInfo); + } + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.items: object expected"); + message.items[keys[i]] = $root.google.cloud.osconfig.v1alpha.Inventory.Item.fromObject(object.items[keys[i]]); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory} message Inventory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Inventory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.items = {}; + if (options.defaults) { + object.osInfo = null; + object.name = ""; + object.updateTime = null; + } + if (message.osInfo != null && message.hasOwnProperty("osInfo")) + object.osInfo = $root.google.cloud.osconfig.v1alpha.Inventory.OsInfo.toObject(message.osInfo, options); + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.osconfig.v1alpha.Inventory.Item.toObject(message.items[keys2[j]], options); + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Inventory to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @instance + * @returns {Object.} JSON object + */ + Inventory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Inventory + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Inventory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.Inventory"; + }; + + Inventory.OsInfo = (function() { + + /** + * Properties of an OsInfo. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @interface IOsInfo + * @property {string|null} [hostname] OsInfo hostname + * @property {string|null} [longName] OsInfo longName + * @property {string|null} [shortName] OsInfo shortName + * @property {string|null} [version] OsInfo version + * @property {string|null} [architecture] OsInfo architecture + * @property {string|null} [kernelVersion] OsInfo kernelVersion + * @property {string|null} [kernelRelease] OsInfo kernelRelease + * @property {string|null} [osconfigAgentVersion] OsInfo osconfigAgentVersion + */ + + /** + * Constructs a new OsInfo. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @classdesc Represents an OsInfo. + * @implements IOsInfo + * @constructor + * @param {google.cloud.osconfig.v1alpha.Inventory.IOsInfo=} [properties] Properties to set + */ + function OsInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OsInfo hostname. + * @member {string} hostname + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.hostname = ""; + + /** + * OsInfo longName. + * @member {string} longName + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.longName = ""; + + /** + * OsInfo shortName. + * @member {string} shortName + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.shortName = ""; + + /** + * OsInfo version. + * @member {string} version + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.version = ""; + + /** + * OsInfo architecture. + * @member {string} architecture + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.architecture = ""; + + /** + * OsInfo kernelVersion. + * @member {string} kernelVersion + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.kernelVersion = ""; + + /** + * OsInfo kernelRelease. + * @member {string} kernelRelease + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.kernelRelease = ""; + + /** + * OsInfo osconfigAgentVersion. + * @member {string} osconfigAgentVersion + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.osconfigAgentVersion = ""; + + /** + * Creates a new OsInfo instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IOsInfo=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.Inventory.OsInfo} OsInfo instance + */ + OsInfo.create = function create(properties) { + return new OsInfo(properties); + }; + + /** + * Encodes the specified OsInfo message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.OsInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IOsInfo} message OsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.longName != null && Object.hasOwnProperty.call(message, "longName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.longName); + if (message.shortName != null && Object.hasOwnProperty.call(message, "shortName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.shortName); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); + if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.architecture); + if (message.kernelVersion != null && Object.hasOwnProperty.call(message, "kernelVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.kernelVersion); + if (message.kernelRelease != null && Object.hasOwnProperty.call(message, "kernelRelease")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.kernelRelease); + if (message.osconfigAgentVersion != null && Object.hasOwnProperty.call(message, "osconfigAgentVersion")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.osconfigAgentVersion); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.hostname); + return writer; + }; + + /** + * Encodes the specified OsInfo message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.OsInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IOsInfo} message OsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OsInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.Inventory.OsInfo} OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.Inventory.OsInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 9: { + message.hostname = reader.string(); + break; + } + case 2: { + message.longName = reader.string(); + break; + } + case 3: { + message.shortName = reader.string(); + break; + } + case 4: { + message.version = reader.string(); + break; + } + case 5: { + message.architecture = reader.string(); + break; + } + case 6: { + message.kernelVersion = reader.string(); + break; + } + case 7: { + message.kernelRelease = reader.string(); + break; + } + case 8: { + message.osconfigAgentVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OsInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.Inventory.OsInfo} OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OsInfo message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OsInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.longName != null && message.hasOwnProperty("longName")) + if (!$util.isString(message.longName)) + return "longName: string expected"; + if (message.shortName != null && message.hasOwnProperty("shortName")) + if (!$util.isString(message.shortName)) + return "shortName: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.architecture != null && message.hasOwnProperty("architecture")) + if (!$util.isString(message.architecture)) + return "architecture: string expected"; + if (message.kernelVersion != null && message.hasOwnProperty("kernelVersion")) + if (!$util.isString(message.kernelVersion)) + return "kernelVersion: string expected"; + if (message.kernelRelease != null && message.hasOwnProperty("kernelRelease")) + if (!$util.isString(message.kernelRelease)) + return "kernelRelease: string expected"; + if (message.osconfigAgentVersion != null && message.hasOwnProperty("osconfigAgentVersion")) + if (!$util.isString(message.osconfigAgentVersion)) + return "osconfigAgentVersion: string expected"; + return null; + }; + + /** + * Creates an OsInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.Inventory.OsInfo} OsInfo + */ + OsInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.Inventory.OsInfo) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.Inventory.OsInfo(); + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.longName != null) + message.longName = String(object.longName); + if (object.shortName != null) + message.shortName = String(object.shortName); + if (object.version != null) + message.version = String(object.version); + if (object.architecture != null) + message.architecture = String(object.architecture); + if (object.kernelVersion != null) + message.kernelVersion = String(object.kernelVersion); + if (object.kernelRelease != null) + message.kernelRelease = String(object.kernelRelease); + if (object.osconfigAgentVersion != null) + message.osconfigAgentVersion = String(object.osconfigAgentVersion); + return message; + }; + + /** + * Creates a plain object from an OsInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.OsInfo} message OsInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OsInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.longName = ""; + object.shortName = ""; + object.version = ""; + object.architecture = ""; + object.kernelVersion = ""; + object.kernelRelease = ""; + object.osconfigAgentVersion = ""; + object.hostname = ""; + } + if (message.longName != null && message.hasOwnProperty("longName")) + object.longName = message.longName; + if (message.shortName != null && message.hasOwnProperty("shortName")) + object.shortName = message.shortName; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.architecture != null && message.hasOwnProperty("architecture")) + object.architecture = message.architecture; + if (message.kernelVersion != null && message.hasOwnProperty("kernelVersion")) + object.kernelVersion = message.kernelVersion; + if (message.kernelRelease != null && message.hasOwnProperty("kernelRelease")) + object.kernelRelease = message.kernelRelease; + if (message.osconfigAgentVersion != null && message.hasOwnProperty("osconfigAgentVersion")) + object.osconfigAgentVersion = message.osconfigAgentVersion; + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + return object; + }; + + /** + * Converts this OsInfo to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @instance + * @returns {Object.} JSON object + */ + OsInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OsInfo + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.Inventory.OsInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OsInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.Inventory.OsInfo"; + }; + + return OsInfo; + })(); + + Inventory.Item = (function() { + + /** + * Properties of an Item. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @interface IItem + * @property {string|null} [id] Item id + * @property {google.cloud.osconfig.v1alpha.Inventory.Item.OriginType|null} [originType] Item originType + * @property {google.protobuf.ITimestamp|null} [createTime] Item createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Item updateTime + * @property {google.cloud.osconfig.v1alpha.Inventory.Item.Type|null} [type] Item type + * @property {google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage|null} [installedPackage] Item installedPackage + * @property {google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage|null} [availablePackage] Item availablePackage + */ + + /** + * Constructs a new Item. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @classdesc Represents an Item. + * @implements IItem + * @constructor + * @param {google.cloud.osconfig.v1alpha.Inventory.IItem=} [properties] Properties to set + */ + function Item(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Item id. + * @member {string} id + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @instance + */ + Item.prototype.id = ""; + + /** + * Item originType. + * @member {google.cloud.osconfig.v1alpha.Inventory.Item.OriginType} originType + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @instance + */ + Item.prototype.originType = 0; + + /** + * Item createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @instance + */ + Item.prototype.createTime = null; + + /** + * Item updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @instance + */ + Item.prototype.updateTime = null; + + /** + * Item type. + * @member {google.cloud.osconfig.v1alpha.Inventory.Item.Type} type + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @instance + */ + Item.prototype.type = 0; + + /** + * Item installedPackage. + * @member {google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage|null|undefined} installedPackage + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @instance + */ + Item.prototype.installedPackage = null; + + /** + * Item availablePackage. + * @member {google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage|null|undefined} availablePackage + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @instance + */ + Item.prototype.availablePackage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Item details. + * @member {"installedPackage"|"availablePackage"|undefined} details + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @instance + */ + Object.defineProperty(Item.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["installedPackage", "availablePackage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Item instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IItem=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.Inventory.Item} Item instance + */ + Item.create = function create(properties) { + return new Item(properties); + }; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.Item.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.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.originType != null && Object.hasOwnProperty.call(message, "originType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.originType); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.installedPackage != null && Object.hasOwnProperty.call(message, "installedPackage")) + $root.google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.encode(message.installedPackage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.availablePackage != null && Object.hasOwnProperty.call(message, "availablePackage")) + $root.google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.encode(message.availablePackage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.Item.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Item message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.Inventory.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.Inventory.Item(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.originType = reader.int32(); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.installedPackage = $root.google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.decode(reader, reader.uint32()); + break; + } + case 7: { + message.availablePackage = $root.google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.Inventory.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Item message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Item.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.originType != null && message.hasOwnProperty("originType")) + switch (message.originType) { + default: + return "originType: enum value expected"; + case 0: + case 1: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.installedPackage != null && message.hasOwnProperty("installedPackage")) { + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.verify(message.installedPackage); + if (error) + return "installedPackage." + error; + } + } + if (message.availablePackage != null && message.hasOwnProperty("availablePackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.verify(message.availablePackage); + if (error) + return "availablePackage." + error; + } + } + return null; + }; + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.Inventory.Item} Item + */ + Item.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.Inventory.Item) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.Inventory.Item(); + if (object.id != null) + message.id = String(object.id); + switch (object.originType) { + default: + if (typeof object.originType === "number") { + message.originType = object.originType; + break; + } + break; + case "ORIGIN_TYPE_UNSPECIFIED": + case 0: + message.originType = 0; + break; + case "INVENTORY_REPORT": + case 1: + message.originType = 1; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.Item.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.osconfig.v1alpha.Inventory.Item.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INSTALLED_PACKAGE": + case 1: + message.type = 1; + break; + case "AVAILABLE_PACKAGE": + case 2: + message.type = 2; + break; + } + if (object.installedPackage != null) { + if (typeof object.installedPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.Item.installedPackage: object expected"); + message.installedPackage = $root.google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.fromObject(object.installedPackage); + } + if (object.availablePackage != null) { + if (typeof object.availablePackage !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.Item.availablePackage: object expected"); + message.availablePackage = $root.google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.fromObject(object.availablePackage); + } + return message; + }; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.Item} message Item + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Item.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.originType = options.enums === String ? "ORIGIN_TYPE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.originType != null && message.hasOwnProperty("originType")) + object.originType = options.enums === String ? $root.google.cloud.osconfig.v1alpha.Inventory.Item.OriginType[message.originType] === undefined ? message.originType : $root.google.cloud.osconfig.v1alpha.Inventory.Item.OriginType[message.originType] : message.originType; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.osconfig.v1alpha.Inventory.Item.Type[message.type] === undefined ? message.type : $root.google.cloud.osconfig.v1alpha.Inventory.Item.Type[message.type] : message.type; + if (message.installedPackage != null && message.hasOwnProperty("installedPackage")) { + object.installedPackage = $root.google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.toObject(message.installedPackage, options); + if (options.oneofs) + object.details = "installedPackage"; + } + if (message.availablePackage != null && message.hasOwnProperty("availablePackage")) { + object.availablePackage = $root.google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.toObject(message.availablePackage, options); + if (options.oneofs) + object.details = "availablePackage"; + } + 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 Item to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @instance + * @returns {Object.} JSON object + */ + Item.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Item + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.Inventory.Item + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Item.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.Inventory.Item"; + }; + + /** + * OriginType enum. + * @name google.cloud.osconfig.v1alpha.Inventory.Item.OriginType + * @enum {number} + * @property {number} ORIGIN_TYPE_UNSPECIFIED=0 ORIGIN_TYPE_UNSPECIFIED value + * @property {number} INVENTORY_REPORT=1 INVENTORY_REPORT value + */ + Item.OriginType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORIGIN_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INVENTORY_REPORT"] = 1; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.osconfig.v1alpha.Inventory.Item.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} INSTALLED_PACKAGE=1 INSTALLED_PACKAGE value + * @property {number} AVAILABLE_PACKAGE=2 AVAILABLE_PACKAGE value + */ + Item.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTALLED_PACKAGE"] = 1; + values[valuesById[2] = "AVAILABLE_PACKAGE"] = 2; + return values; + })(); + + return Item; + })(); + + Inventory.SoftwarePackage = (function() { + + /** + * Properties of a SoftwarePackage. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @interface ISoftwarePackage + * @property {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null} [yumPackage] SoftwarePackage yumPackage + * @property {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null} [aptPackage] SoftwarePackage aptPackage + * @property {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null} [zypperPackage] SoftwarePackage zypperPackage + * @property {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null} [googetPackage] SoftwarePackage googetPackage + * @property {google.cloud.osconfig.v1alpha.Inventory.IZypperPatch|null} [zypperPatch] SoftwarePackage zypperPatch + * @property {google.cloud.osconfig.v1alpha.Inventory.IWindowsUpdatePackage|null} [wuaPackage] SoftwarePackage wuaPackage + * @property {google.cloud.osconfig.v1alpha.Inventory.IWindowsQuickFixEngineeringPackage|null} [qfePackage] SoftwarePackage qfePackage + * @property {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null} [cosPackage] SoftwarePackage cosPackage + * @property {google.cloud.osconfig.v1alpha.Inventory.IWindowsApplication|null} [windowsApplication] SoftwarePackage windowsApplication + */ + + /** + * Constructs a new SoftwarePackage. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @classdesc Represents a SoftwarePackage. + * @implements ISoftwarePackage + * @constructor + * @param {google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage=} [properties] Properties to set + */ + function SoftwarePackage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SoftwarePackage yumPackage. + * @member {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null|undefined} yumPackage + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.yumPackage = null; + + /** + * SoftwarePackage aptPackage. + * @member {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null|undefined} aptPackage + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.aptPackage = null; + + /** + * SoftwarePackage zypperPackage. + * @member {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null|undefined} zypperPackage + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.zypperPackage = null; + + /** + * SoftwarePackage googetPackage. + * @member {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null|undefined} googetPackage + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.googetPackage = null; + + /** + * SoftwarePackage zypperPatch. + * @member {google.cloud.osconfig.v1alpha.Inventory.IZypperPatch|null|undefined} zypperPatch + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.zypperPatch = null; + + /** + * SoftwarePackage wuaPackage. + * @member {google.cloud.osconfig.v1alpha.Inventory.IWindowsUpdatePackage|null|undefined} wuaPackage + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.wuaPackage = null; + + /** + * SoftwarePackage qfePackage. + * @member {google.cloud.osconfig.v1alpha.Inventory.IWindowsQuickFixEngineeringPackage|null|undefined} qfePackage + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.qfePackage = null; + + /** + * SoftwarePackage cosPackage. + * @member {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage|null|undefined} cosPackage + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.cosPackage = null; + + /** + * SoftwarePackage windowsApplication. + * @member {google.cloud.osconfig.v1alpha.Inventory.IWindowsApplication|null|undefined} windowsApplication + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.windowsApplication = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SoftwarePackage details. + * @member {"yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|"windowsApplication"|undefined} details + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @instance + */ + Object.defineProperty(SoftwarePackage.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["yumPackage", "aptPackage", "zypperPackage", "googetPackage", "zypperPatch", "wuaPackage", "qfePackage", "cosPackage", "windowsApplication"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SoftwarePackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage} SoftwarePackage instance + */ + SoftwarePackage.create = function create(properties) { + return new SoftwarePackage(properties); + }; + + /** + * Encodes the specified SoftwarePackage message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage} message SoftwarePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwarePackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.yumPackage != null && Object.hasOwnProperty.call(message, "yumPackage")) + $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.encode(message.yumPackage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.aptPackage != null && Object.hasOwnProperty.call(message, "aptPackage")) + $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.encode(message.aptPackage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.zypperPackage != null && Object.hasOwnProperty.call(message, "zypperPackage")) + $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.encode(message.zypperPackage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.googetPackage != null && Object.hasOwnProperty.call(message, "googetPackage")) + $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.encode(message.googetPackage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.zypperPatch != null && Object.hasOwnProperty.call(message, "zypperPatch")) + $root.google.cloud.osconfig.v1alpha.Inventory.ZypperPatch.encode(message.zypperPatch, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.wuaPackage != null && Object.hasOwnProperty.call(message, "wuaPackage")) + $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.encode(message.wuaPackage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.qfePackage != null && Object.hasOwnProperty.call(message, "qfePackage")) + $root.google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage.encode(message.qfePackage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.cosPackage != null && Object.hasOwnProperty.call(message, "cosPackage")) + $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.encode(message.cosPackage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.windowsApplication != null && Object.hasOwnProperty.call(message, "windowsApplication")) + $root.google.cloud.osconfig.v1alpha.Inventory.WindowsApplication.encode(message.windowsApplication, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SoftwarePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.ISoftwarePackage} message SoftwarePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwarePackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage} SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwarePackage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.yumPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 2: { + message.aptPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 3: { + message.zypperPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 4: { + message.googetPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 5: { + message.zypperPatch = $root.google.cloud.osconfig.v1alpha.Inventory.ZypperPatch.decode(reader, reader.uint32()); + break; + } + case 6: { + message.wuaPackage = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.decode(reader, reader.uint32()); + break; + } + case 7: { + message.qfePackage = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage.decode(reader, reader.uint32()); + break; + } + case 8: { + message.cosPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 9: { + message.windowsApplication = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsApplication.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage} SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwarePackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoftwarePackage message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoftwarePackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.yumPackage != null && message.hasOwnProperty("yumPackage")) { + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.verify(message.yumPackage); + if (error) + return "yumPackage." + error; + } + } + if (message.aptPackage != null && message.hasOwnProperty("aptPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.verify(message.aptPackage); + if (error) + return "aptPackage." + error; + } + } + if (message.zypperPackage != null && message.hasOwnProperty("zypperPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.verify(message.zypperPackage); + if (error) + return "zypperPackage." + error; + } + } + if (message.googetPackage != null && message.hasOwnProperty("googetPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.verify(message.googetPackage); + if (error) + return "googetPackage." + error; + } + } + if (message.zypperPatch != null && message.hasOwnProperty("zypperPatch")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.ZypperPatch.verify(message.zypperPatch); + if (error) + return "zypperPatch." + error; + } + } + if (message.wuaPackage != null && message.hasOwnProperty("wuaPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.verify(message.wuaPackage); + if (error) + return "wuaPackage." + error; + } + } + if (message.qfePackage != null && message.hasOwnProperty("qfePackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage.verify(message.qfePackage); + if (error) + return "qfePackage." + error; + } + } + if (message.cosPackage != null && message.hasOwnProperty("cosPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.verify(message.cosPackage); + if (error) + return "cosPackage." + error; + } + } + if (message.windowsApplication != null && message.hasOwnProperty("windowsApplication")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsApplication.verify(message.windowsApplication); + if (error) + return "windowsApplication." + error; + } + } + return null; + }; + + /** + * Creates a SoftwarePackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage} SoftwarePackage + */ + SoftwarePackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage(); + if (object.yumPackage != null) { + if (typeof object.yumPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.yumPackage: object expected"); + message.yumPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.fromObject(object.yumPackage); + } + if (object.aptPackage != null) { + if (typeof object.aptPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.aptPackage: object expected"); + message.aptPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.fromObject(object.aptPackage); + } + if (object.zypperPackage != null) { + if (typeof object.zypperPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.zypperPackage: object expected"); + message.zypperPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.fromObject(object.zypperPackage); + } + if (object.googetPackage != null) { + if (typeof object.googetPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.googetPackage: object expected"); + message.googetPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.fromObject(object.googetPackage); + } + if (object.zypperPatch != null) { + if (typeof object.zypperPatch !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.zypperPatch: object expected"); + message.zypperPatch = $root.google.cloud.osconfig.v1alpha.Inventory.ZypperPatch.fromObject(object.zypperPatch); + } + if (object.wuaPackage != null) { + if (typeof object.wuaPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.wuaPackage: object expected"); + message.wuaPackage = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.fromObject(object.wuaPackage); + } + if (object.qfePackage != null) { + if (typeof object.qfePackage !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.qfePackage: object expected"); + message.qfePackage = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage.fromObject(object.qfePackage); + } + if (object.cosPackage != null) { + if (typeof object.cosPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.cosPackage: object expected"); + message.cosPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.fromObject(object.cosPackage); + } + if (object.windowsApplication != null) { + if (typeof object.windowsApplication !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage.windowsApplication: object expected"); + message.windowsApplication = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsApplication.fromObject(object.windowsApplication); + } + return message; + }; + + /** + * Creates a plain object from a SoftwarePackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage} message SoftwarePackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoftwarePackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.yumPackage != null && message.hasOwnProperty("yumPackage")) { + object.yumPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.toObject(message.yumPackage, options); + if (options.oneofs) + object.details = "yumPackage"; + } + if (message.aptPackage != null && message.hasOwnProperty("aptPackage")) { + object.aptPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.toObject(message.aptPackage, options); + if (options.oneofs) + object.details = "aptPackage"; + } + if (message.zypperPackage != null && message.hasOwnProperty("zypperPackage")) { + object.zypperPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.toObject(message.zypperPackage, options); + if (options.oneofs) + object.details = "zypperPackage"; + } + if (message.googetPackage != null && message.hasOwnProperty("googetPackage")) { + object.googetPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.toObject(message.googetPackage, options); + if (options.oneofs) + object.details = "googetPackage"; + } + if (message.zypperPatch != null && message.hasOwnProperty("zypperPatch")) { + object.zypperPatch = $root.google.cloud.osconfig.v1alpha.Inventory.ZypperPatch.toObject(message.zypperPatch, options); + if (options.oneofs) + object.details = "zypperPatch"; + } + if (message.wuaPackage != null && message.hasOwnProperty("wuaPackage")) { + object.wuaPackage = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.toObject(message.wuaPackage, options); + if (options.oneofs) + object.details = "wuaPackage"; + } + if (message.qfePackage != null && message.hasOwnProperty("qfePackage")) { + object.qfePackage = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage.toObject(message.qfePackage, options); + if (options.oneofs) + object.details = "qfePackage"; + } + if (message.cosPackage != null && message.hasOwnProperty("cosPackage")) { + object.cosPackage = $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.toObject(message.cosPackage, options); + if (options.oneofs) + object.details = "cosPackage"; + } + if (message.windowsApplication != null && message.hasOwnProperty("windowsApplication")) { + object.windowsApplication = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsApplication.toObject(message.windowsApplication, options); + if (options.oneofs) + object.details = "windowsApplication"; + } + return object; + }; + + /** + * Converts this SoftwarePackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @instance + * @returns {Object.} JSON object + */ + SoftwarePackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SoftwarePackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SoftwarePackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.Inventory.SoftwarePackage"; + }; + + return SoftwarePackage; + })(); + + Inventory.VersionedPackage = (function() { + + /** + * Properties of a VersionedPackage. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @interface IVersionedPackage + * @property {string|null} [packageName] VersionedPackage packageName + * @property {string|null} [architecture] VersionedPackage architecture + * @property {string|null} [version] VersionedPackage version + */ + + /** + * Constructs a new VersionedPackage. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @classdesc Represents a VersionedPackage. + * @implements IVersionedPackage + * @constructor + * @param {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage=} [properties] Properties to set + */ + function VersionedPackage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionedPackage packageName. + * @member {string} packageName + * @memberof google.cloud.osconfig.v1alpha.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.packageName = ""; + + /** + * VersionedPackage architecture. + * @member {string} architecture + * @memberof google.cloud.osconfig.v1alpha.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.architecture = ""; + + /** + * VersionedPackage version. + * @member {string} version + * @memberof google.cloud.osconfig.v1alpha.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.version = ""; + + /** + * Creates a new VersionedPackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.Inventory.VersionedPackage} VersionedPackage instance + */ + VersionedPackage.create = function create(properties) { + return new VersionedPackage(properties); + }; + + /** + * Encodes the specified VersionedPackage message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage} message VersionedPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedPackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.architecture); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.version); + if (message.packageName != null && Object.hasOwnProperty.call(message, "packageName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.packageName); + return writer; + }; + + /** + * Encodes the specified VersionedPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.VersionedPackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IVersionedPackage} message VersionedPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedPackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.Inventory.VersionedPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.Inventory.VersionedPackage} VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedPackage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.packageName = reader.string(); + break; + } + case 2: { + message.architecture = reader.string(); + break; + } + case 3: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.VersionedPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.Inventory.VersionedPackage} VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedPackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionedPackage message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.Inventory.VersionedPackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionedPackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packageName != null && message.hasOwnProperty("packageName")) + if (!$util.isString(message.packageName)) + return "packageName: string expected"; + if (message.architecture != null && message.hasOwnProperty("architecture")) + if (!$util.isString(message.architecture)) + return "architecture: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a VersionedPackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.VersionedPackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.Inventory.VersionedPackage} VersionedPackage + */ + VersionedPackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.Inventory.VersionedPackage(); + if (object.packageName != null) + message.packageName = String(object.packageName); + if (object.architecture != null) + message.architecture = String(object.architecture); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a VersionedPackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.VersionedPackage} message VersionedPackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionedPackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.architecture = ""; + object.version = ""; + object.packageName = ""; + } + if (message.architecture != null && message.hasOwnProperty("architecture")) + object.architecture = message.architecture; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.packageName != null && message.hasOwnProperty("packageName")) + object.packageName = message.packageName; + return object; + }; + + /** + * Converts this VersionedPackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.Inventory.VersionedPackage + * @instance + * @returns {Object.} JSON object + */ + VersionedPackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VersionedPackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.Inventory.VersionedPackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VersionedPackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.Inventory.VersionedPackage"; + }; + + return VersionedPackage; + })(); + + Inventory.ZypperPatch = (function() { + + /** + * Properties of a ZypperPatch. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @interface IZypperPatch + * @property {string|null} [patchName] ZypperPatch patchName + * @property {string|null} [category] ZypperPatch category + * @property {string|null} [severity] ZypperPatch severity + * @property {string|null} [summary] ZypperPatch summary + */ + + /** + * Constructs a new ZypperPatch. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @classdesc Represents a ZypperPatch. + * @implements IZypperPatch + * @constructor + * @param {google.cloud.osconfig.v1alpha.Inventory.IZypperPatch=} [properties] Properties to set + */ + function ZypperPatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ZypperPatch patchName. + * @member {string} patchName + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.patchName = ""; + + /** + * ZypperPatch category. + * @member {string} category + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.category = ""; + + /** + * ZypperPatch severity. + * @member {string} severity + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.severity = ""; + + /** + * ZypperPatch summary. + * @member {string} summary + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.summary = ""; + + /** + * Creates a new ZypperPatch instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IZypperPatch=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.Inventory.ZypperPatch} ZypperPatch instance + */ + ZypperPatch.create = function create(properties) { + return new ZypperPatch(properties); + }; + + /** + * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.ZypperPatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperPatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.category); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.severity); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.summary); + if (message.patchName != null && Object.hasOwnProperty.call(message, "patchName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.patchName); + return writer; + }; + + /** + * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.ZypperPatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperPatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.Inventory.ZypperPatch} ZypperPatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperPatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.Inventory.ZypperPatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.patchName = reader.string(); + break; + } + case 2: { + message.category = reader.string(); + break; + } + case 3: { + message.severity = reader.string(); + break; + } + case 4: { + message.summary = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.Inventory.ZypperPatch} ZypperPatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperPatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZypperPatch message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZypperPatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.patchName != null && message.hasOwnProperty("patchName")) + if (!$util.isString(message.patchName)) + return "patchName: string expected"; + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + if (!$util.isString(message.severity)) + return "severity: string expected"; + if (message.summary != null && message.hasOwnProperty("summary")) + if (!$util.isString(message.summary)) + return "summary: string expected"; + return null; + }; + + /** + * Creates a ZypperPatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.Inventory.ZypperPatch} ZypperPatch + */ + ZypperPatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.Inventory.ZypperPatch) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.Inventory.ZypperPatch(); + if (object.patchName != null) + message.patchName = String(object.patchName); + if (object.category != null) + message.category = String(object.category); + if (object.severity != null) + message.severity = String(object.severity); + if (object.summary != null) + message.summary = String(object.summary); + return message; + }; + + /** + * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.ZypperPatch} message ZypperPatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZypperPatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = ""; + object.severity = ""; + object.summary = ""; + object.patchName = ""; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = message.severity; + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = message.summary; + if (message.patchName != null && message.hasOwnProperty("patchName")) + object.patchName = message.patchName; + return object; + }; + + /** + * Converts this ZypperPatch to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @instance + * @returns {Object.} JSON object + */ + ZypperPatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ZypperPatch + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.Inventory.ZypperPatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ZypperPatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.Inventory.ZypperPatch"; + }; + + return ZypperPatch; + })(); + + Inventory.WindowsUpdatePackage = (function() { + + /** + * Properties of a WindowsUpdatePackage. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @interface IWindowsUpdatePackage + * @property {string|null} [title] WindowsUpdatePackage title + * @property {string|null} [description] WindowsUpdatePackage description + * @property {Array.|null} [categories] WindowsUpdatePackage categories + * @property {Array.|null} [kbArticleIds] WindowsUpdatePackage kbArticleIds + * @property {string|null} [supportUrl] WindowsUpdatePackage supportUrl + * @property {Array.|null} [moreInfoUrls] WindowsUpdatePackage moreInfoUrls + * @property {string|null} [updateId] WindowsUpdatePackage updateId + * @property {number|null} [revisionNumber] WindowsUpdatePackage revisionNumber + * @property {google.protobuf.ITimestamp|null} [lastDeploymentChangeTime] WindowsUpdatePackage lastDeploymentChangeTime + */ + + /** + * Constructs a new WindowsUpdatePackage. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @classdesc Represents a WindowsUpdatePackage. + * @implements IWindowsUpdatePackage + * @constructor + * @param {google.cloud.osconfig.v1alpha.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + */ + function WindowsUpdatePackage(properties) { + this.categories = []; + this.kbArticleIds = []; + this.moreInfoUrls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowsUpdatePackage title. + * @member {string} title + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.title = ""; + + /** + * WindowsUpdatePackage description. + * @member {string} description + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.description = ""; + + /** + * WindowsUpdatePackage categories. + * @member {Array.} categories + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.categories = $util.emptyArray; + + /** + * WindowsUpdatePackage kbArticleIds. + * @member {Array.} kbArticleIds + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.kbArticleIds = $util.emptyArray; + + /** + * WindowsUpdatePackage supportUrl. + * @member {string} supportUrl + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.supportUrl = ""; + + /** + * WindowsUpdatePackage moreInfoUrls. + * @member {Array.} moreInfoUrls + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.moreInfoUrls = $util.emptyArray; + + /** + * WindowsUpdatePackage updateId. + * @member {string} updateId + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.updateId = ""; + + /** + * WindowsUpdatePackage revisionNumber. + * @member {number} revisionNumber + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.revisionNumber = 0; + + /** + * WindowsUpdatePackage lastDeploymentChangeTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastDeploymentChangeTime + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.lastDeploymentChangeTime = null; + + /** + * Creates a new WindowsUpdatePackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage} WindowsUpdatePackage instance + */ + WindowsUpdatePackage.create = function create(properties) { + return new WindowsUpdatePackage(properties); + }; + + /** + * Encodes the specified WindowsUpdatePackage message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdatePackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.encode(message.categories[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.kbArticleIds != null && message.kbArticleIds.length) + for (var i = 0; i < message.kbArticleIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kbArticleIds[i]); + if (message.moreInfoUrls != null && message.moreInfoUrls.length) + for (var i = 0; i < message.moreInfoUrls.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.moreInfoUrls[i]); + if (message.updateId != null && Object.hasOwnProperty.call(message, "updateId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.updateId); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.revisionNumber); + if (message.lastDeploymentChangeTime != null && Object.hasOwnProperty.call(message, "lastDeploymentChangeTime")) + $root.google.protobuf.Timestamp.encode(message.lastDeploymentChangeTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.supportUrl != null && Object.hasOwnProperty.call(message, "supportUrl")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.supportUrl); + return writer; + }; + + /** + * Encodes the specified WindowsUpdatePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdatePackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdatePackage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.title = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push($root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.kbArticleIds && message.kbArticleIds.length)) + message.kbArticleIds = []; + message.kbArticleIds.push(reader.string()); + break; + } + case 11: { + message.supportUrl = reader.string(); + break; + } + case 5: { + if (!(message.moreInfoUrls && message.moreInfoUrls.length)) + message.moreInfoUrls = []; + message.moreInfoUrls.push(reader.string()); + break; + } + case 6: { + message.updateId = reader.string(); + break; + } + case 7: { + message.revisionNumber = reader.int32(); + break; + } + case 10: { + message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdatePackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsUpdatePackage message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsUpdatePackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify(message.categories[i]); + if (error) + return "categories." + error; + } + } + if (message.kbArticleIds != null && message.hasOwnProperty("kbArticleIds")) { + if (!Array.isArray(message.kbArticleIds)) + return "kbArticleIds: array expected"; + for (var i = 0; i < message.kbArticleIds.length; ++i) + if (!$util.isString(message.kbArticleIds[i])) + return "kbArticleIds: string[] expected"; + } + if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) + if (!$util.isString(message.supportUrl)) + return "supportUrl: string expected"; + if (message.moreInfoUrls != null && message.hasOwnProperty("moreInfoUrls")) { + if (!Array.isArray(message.moreInfoUrls)) + return "moreInfoUrls: array expected"; + for (var i = 0; i < message.moreInfoUrls.length; ++i) + if (!$util.isString(message.moreInfoUrls[i])) + return "moreInfoUrls: string[] expected"; + } + if (message.updateId != null && message.hasOwnProperty("updateId")) + if (!$util.isString(message.updateId)) + return "updateId: string expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber)) + return "revisionNumber: integer expected"; + if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastDeploymentChangeTime); + if (error) + return "lastDeploymentChangeTime." + error; + } + return null; + }; + + /** + * Creates a WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + */ + WindowsUpdatePackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) { + if (typeof object.categories[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.categories: object expected"); + message.categories[i] = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.fromObject(object.categories[i]); + } + } + if (object.kbArticleIds) { + if (!Array.isArray(object.kbArticleIds)) + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.kbArticleIds: array expected"); + message.kbArticleIds = []; + for (var i = 0; i < object.kbArticleIds.length; ++i) + message.kbArticleIds[i] = String(object.kbArticleIds[i]); + } + if (object.supportUrl != null) + message.supportUrl = String(object.supportUrl); + if (object.moreInfoUrls) { + if (!Array.isArray(object.moreInfoUrls)) + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.moreInfoUrls: array expected"); + message.moreInfoUrls = []; + for (var i = 0; i < object.moreInfoUrls.length; ++i) + message.moreInfoUrls[i] = String(object.moreInfoUrls[i]); + } + if (object.updateId != null) + message.updateId = String(object.updateId); + if (object.revisionNumber != null) + message.revisionNumber = object.revisionNumber | 0; + if (object.lastDeploymentChangeTime != null) { + if (typeof object.lastDeploymentChangeTime !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.lastDeploymentChangeTime: object expected"); + message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.fromObject(object.lastDeploymentChangeTime); + } + return message; + }; + + /** + * Creates a plain object from a WindowsUpdatePackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage} message WindowsUpdatePackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsUpdatePackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.categories = []; + object.kbArticleIds = []; + object.moreInfoUrls = []; + } + if (options.defaults) { + object.title = ""; + object.description = ""; + object.updateId = ""; + object.revisionNumber = 0; + object.lastDeploymentChangeTime = null; + object.supportUrl = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.toObject(message.categories[j], options); + } + if (message.kbArticleIds && message.kbArticleIds.length) { + object.kbArticleIds = []; + for (var j = 0; j < message.kbArticleIds.length; ++j) + object.kbArticleIds[j] = message.kbArticleIds[j]; + } + if (message.moreInfoUrls && message.moreInfoUrls.length) { + object.moreInfoUrls = []; + for (var j = 0; j < message.moreInfoUrls.length; ++j) + object.moreInfoUrls[j] = message.moreInfoUrls[j]; + } + if (message.updateId != null && message.hasOwnProperty("updateId")) + object.updateId = message.updateId; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + object.revisionNumber = message.revisionNumber; + if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) + object.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.toObject(message.lastDeploymentChangeTime, options); + if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) + object.supportUrl = message.supportUrl; + return object; + }; + + /** + * Converts this WindowsUpdatePackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @instance + * @returns {Object.} JSON object + */ + WindowsUpdatePackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowsUpdatePackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsUpdatePackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage"; + }; + + WindowsUpdatePackage.WindowsUpdateCategory = (function() { + + /** + * Properties of a WindowsUpdateCategory. + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @interface IWindowsUpdateCategory + * @property {string|null} [id] WindowsUpdateCategory id + * @property {string|null} [name] WindowsUpdateCategory name + */ + + /** + * Constructs a new WindowsUpdateCategory. + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage + * @classdesc Represents a WindowsUpdateCategory. + * @implements IWindowsUpdateCategory + * @constructor + * @param {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set + */ + function WindowsUpdateCategory(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowsUpdateCategory id. + * @member {string} id + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + */ + WindowsUpdateCategory.prototype.id = ""; + + /** + * WindowsUpdateCategory name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + */ + WindowsUpdateCategory.prototype.name = ""; + + /** + * Creates a new WindowsUpdateCategory instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory instance + */ + WindowsUpdateCategory.create = function create(properties) { + return new WindowsUpdateCategory(properties); + }; + + /** + * Encodes the specified WindowsUpdateCategory message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateCategory.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified WindowsUpdateCategory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateCategory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateCategory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateCategory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsUpdateCategory message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsUpdateCategory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a WindowsUpdateCategory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + */ + WindowsUpdateCategory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a WindowsUpdateCategory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} message WindowsUpdateCategory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsUpdateCategory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.name = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this WindowsUpdateCategory to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + * @returns {Object.} JSON object + */ + WindowsUpdateCategory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowsUpdateCategory + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsUpdateCategory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.Inventory.WindowsUpdatePackage.WindowsUpdateCategory"; + }; + + return WindowsUpdateCategory; + })(); + + return WindowsUpdatePackage; + })(); + + Inventory.WindowsQuickFixEngineeringPackage = (function() { + + /** + * Properties of a WindowsQuickFixEngineeringPackage. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @interface IWindowsQuickFixEngineeringPackage + * @property {string|null} [caption] WindowsQuickFixEngineeringPackage caption + * @property {string|null} [description] WindowsQuickFixEngineeringPackage description + * @property {string|null} [hotFixId] WindowsQuickFixEngineeringPackage hotFixId + * @property {google.protobuf.ITimestamp|null} [installTime] WindowsQuickFixEngineeringPackage installTime + */ + + /** + * Constructs a new WindowsQuickFixEngineeringPackage. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @classdesc Represents a WindowsQuickFixEngineeringPackage. + * @implements IWindowsQuickFixEngineeringPackage + * @constructor + * @param {google.cloud.osconfig.v1alpha.Inventory.IWindowsQuickFixEngineeringPackage=} [properties] Properties to set + */ + function WindowsQuickFixEngineeringPackage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowsQuickFixEngineeringPackage caption. + * @member {string} caption + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.caption = ""; + + /** + * WindowsQuickFixEngineeringPackage description. + * @member {string} description + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.description = ""; + + /** + * WindowsQuickFixEngineeringPackage hotFixId. + * @member {string} hotFixId + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.hotFixId = ""; + + /** + * WindowsQuickFixEngineeringPackage installTime. + * @member {google.protobuf.ITimestamp|null|undefined} installTime + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.installTime = null; + + /** + * Creates a new WindowsQuickFixEngineeringPackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IWindowsQuickFixEngineeringPackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage instance + */ + WindowsQuickFixEngineeringPackage.create = function create(properties) { + return new WindowsQuickFixEngineeringPackage(properties); + }; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IWindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsQuickFixEngineeringPackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.caption); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.hotFixId != null && Object.hasOwnProperty.call(message, "hotFixId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.hotFixId); + if (message.installTime != null && Object.hasOwnProperty.call(message, "installTime")) + $root.google.protobuf.Timestamp.encode(message.installTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IWindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsQuickFixEngineeringPackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsQuickFixEngineeringPackage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.caption = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.hotFixId = reader.string(); + break; + } + case 5: { + message.installTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsQuickFixEngineeringPackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsQuickFixEngineeringPackage message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsQuickFixEngineeringPackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.hotFixId != null && message.hasOwnProperty("hotFixId")) + if (!$util.isString(message.hotFixId)) + return "hotFixId: string expected"; + if (message.installTime != null && message.hasOwnProperty("installTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.installTime); + if (error) + return "installTime." + error; + } + return null; + }; + + /** + * Creates a WindowsQuickFixEngineeringPackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + */ + WindowsQuickFixEngineeringPackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage(); + if (object.caption != null) + message.caption = String(object.caption); + if (object.description != null) + message.description = String(object.description); + if (object.hotFixId != null) + message.hotFixId = String(object.hotFixId); + if (object.installTime != null) { + if (typeof object.installTime !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage.installTime: object expected"); + message.installTime = $root.google.protobuf.Timestamp.fromObject(object.installTime); + } + return message; + }; + + /** + * Creates a plain object from a WindowsQuickFixEngineeringPackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsQuickFixEngineeringPackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.caption = ""; + object.description = ""; + object.hotFixId = ""; + object.installTime = null; + } + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.hotFixId != null && message.hasOwnProperty("hotFixId")) + object.hotFixId = message.hotFixId; + if (message.installTime != null && message.hasOwnProperty("installTime")) + object.installTime = $root.google.protobuf.Timestamp.toObject(message.installTime, options); + return object; + }; + + /** + * Converts this WindowsQuickFixEngineeringPackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @instance + * @returns {Object.} JSON object + */ + WindowsQuickFixEngineeringPackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowsQuickFixEngineeringPackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsQuickFixEngineeringPackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.Inventory.WindowsQuickFixEngineeringPackage"; + }; + + return WindowsQuickFixEngineeringPackage; + })(); + + Inventory.WindowsApplication = (function() { + + /** + * Properties of a WindowsApplication. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @interface IWindowsApplication + * @property {string|null} [displayName] WindowsApplication displayName + * @property {string|null} [displayVersion] WindowsApplication displayVersion + * @property {string|null} [publisher] WindowsApplication publisher + * @property {google.type.IDate|null} [installDate] WindowsApplication installDate + * @property {string|null} [helpLink] WindowsApplication helpLink + */ + + /** + * Constructs a new WindowsApplication. + * @memberof google.cloud.osconfig.v1alpha.Inventory + * @classdesc Represents a WindowsApplication. + * @implements IWindowsApplication + * @constructor + * @param {google.cloud.osconfig.v1alpha.Inventory.IWindowsApplication=} [properties] Properties to set + */ + function WindowsApplication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowsApplication displayName. + * @member {string} displayName + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.displayName = ""; + + /** + * WindowsApplication displayVersion. + * @member {string} displayVersion + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.displayVersion = ""; + + /** + * WindowsApplication publisher. + * @member {string} publisher + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.publisher = ""; + + /** + * WindowsApplication installDate. + * @member {google.type.IDate|null|undefined} installDate + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.installDate = null; + + /** + * WindowsApplication helpLink. + * @member {string} helpLink + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.helpLink = ""; + + /** + * Creates a new WindowsApplication instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IWindowsApplication=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsApplication} WindowsApplication instance + */ + WindowsApplication.create = function create(properties) { + return new WindowsApplication(properties); + }; + + /** + * Encodes the specified WindowsApplication message. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsApplication.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IWindowsApplication} message WindowsApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsApplication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.displayVersion != null && Object.hasOwnProperty.call(message, "displayVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayVersion); + if (message.publisher != null && Object.hasOwnProperty.call(message, "publisher")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publisher); + if (message.installDate != null && Object.hasOwnProperty.call(message, "installDate")) + $root.google.type.Date.encode(message.installDate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.helpLink != null && Object.hasOwnProperty.call(message, "helpLink")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.helpLink); + return writer; + }; + + /** + * Encodes the specified WindowsApplication message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.Inventory.WindowsApplication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.IWindowsApplication} message WindowsApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsApplication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsApplication} WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsApplication.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.Inventory.WindowsApplication(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.displayVersion = reader.string(); + break; + } + case 3: { + message.publisher = reader.string(); + break; + } + case 4: { + message.installDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 5: { + message.helpLink = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsApplication} WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsApplication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsApplication message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsApplication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.displayVersion != null && message.hasOwnProperty("displayVersion")) + if (!$util.isString(message.displayVersion)) + return "displayVersion: string expected"; + if (message.publisher != null && message.hasOwnProperty("publisher")) + if (!$util.isString(message.publisher)) + return "publisher: string expected"; + if (message.installDate != null && message.hasOwnProperty("installDate")) { + var error = $root.google.type.Date.verify(message.installDate); + if (error) + return "installDate." + error; + } + if (message.helpLink != null && message.hasOwnProperty("helpLink")) + if (!$util.isString(message.helpLink)) + return "helpLink: string expected"; + return null; + }; + + /** + * Creates a WindowsApplication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.Inventory.WindowsApplication} WindowsApplication + */ + WindowsApplication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.Inventory.WindowsApplication) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.Inventory.WindowsApplication(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.displayVersion != null) + message.displayVersion = String(object.displayVersion); + if (object.publisher != null) + message.publisher = String(object.publisher); + if (object.installDate != null) { + if (typeof object.installDate !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.Inventory.WindowsApplication.installDate: object expected"); + message.installDate = $root.google.type.Date.fromObject(object.installDate); + } + if (object.helpLink != null) + message.helpLink = String(object.helpLink); + return message; + }; + + /** + * Creates a plain object from a WindowsApplication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1alpha.Inventory.WindowsApplication} message WindowsApplication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsApplication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.displayVersion = ""; + object.publisher = ""; + object.installDate = null; + object.helpLink = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.displayVersion != null && message.hasOwnProperty("displayVersion")) + object.displayVersion = message.displayVersion; + if (message.publisher != null && message.hasOwnProperty("publisher")) + object.publisher = message.publisher; + if (message.installDate != null && message.hasOwnProperty("installDate")) + object.installDate = $root.google.type.Date.toObject(message.installDate, options); + if (message.helpLink != null && message.hasOwnProperty("helpLink")) + object.helpLink = message.helpLink; + return object; + }; + + /** + * Converts this WindowsApplication to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @instance + * @returns {Object.} JSON object + */ + WindowsApplication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowsApplication + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.Inventory.WindowsApplication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsApplication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.Inventory.WindowsApplication"; + }; + + return WindowsApplication; + })(); + + return Inventory; + })(); + + v1alpha.GetInventoryRequest = (function() { + + /** + * Properties of a GetInventoryRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface IGetInventoryRequest + * @property {string|null} [name] GetInventoryRequest name + * @property {google.cloud.osconfig.v1alpha.InventoryView|null} [view] GetInventoryRequest view + */ + + /** + * Constructs a new GetInventoryRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a GetInventoryRequest. + * @implements IGetInventoryRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.IGetInventoryRequest=} [properties] Properties to set + */ + function GetInventoryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInventoryRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.GetInventoryRequest + * @instance + */ + GetInventoryRequest.prototype.name = ""; + + /** + * GetInventoryRequest view. + * @member {google.cloud.osconfig.v1alpha.InventoryView} view + * @memberof google.cloud.osconfig.v1alpha.GetInventoryRequest + * @instance + */ + GetInventoryRequest.prototype.view = 0; + + /** + * Creates a new GetInventoryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetInventoryRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.GetInventoryRequest} GetInventoryRequest instance + */ + GetInventoryRequest.create = function create(properties) { + return new GetInventoryRequest(properties); + }; + + /** + * Encodes the specified GetInventoryRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetInventoryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetInventoryRequest} message GetInventoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInventoryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetInventoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetInventoryRequest} message GetInventoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInventoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.GetInventoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.GetInventoryRequest} GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInventoryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.GetInventoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.GetInventoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.GetInventoryRequest} GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInventoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInventoryRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.GetInventoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInventoryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.GetInventoryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.GetInventoryRequest} GetInventoryRequest + */ + GetInventoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.GetInventoryRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.GetInventoryRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "INVENTORY_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetInventoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1alpha.GetInventoryRequest} message GetInventoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInventoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "INVENTORY_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.osconfig.v1alpha.InventoryView[message.view] === undefined ? message.view : $root.google.cloud.osconfig.v1alpha.InventoryView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetInventoryRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.GetInventoryRequest + * @instance + * @returns {Object.} JSON object + */ + GetInventoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInventoryRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.GetInventoryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInventoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.GetInventoryRequest"; + }; + + return GetInventoryRequest; + })(); + + v1alpha.ListInventoriesRequest = (function() { + + /** + * Properties of a ListInventoriesRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface IListInventoriesRequest + * @property {string|null} [parent] ListInventoriesRequest parent + * @property {google.cloud.osconfig.v1alpha.InventoryView|null} [view] ListInventoriesRequest view + * @property {number|null} [pageSize] ListInventoriesRequest pageSize + * @property {string|null} [pageToken] ListInventoriesRequest pageToken + * @property {string|null} [filter] ListInventoriesRequest filter + */ + + /** + * Constructs a new ListInventoriesRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a ListInventoriesRequest. + * @implements IListInventoriesRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.IListInventoriesRequest=} [properties] Properties to set + */ + function ListInventoriesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInventoriesRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.parent = ""; + + /** + * ListInventoriesRequest view. + * @member {google.cloud.osconfig.v1alpha.InventoryView} view + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.view = 0; + + /** + * ListInventoriesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.pageSize = 0; + + /** + * ListInventoriesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.pageToken = ""; + + /** + * ListInventoriesRequest filter. + * @member {string} filter + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.filter = ""; + + /** + * Creates a new ListInventoriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListInventoriesRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.ListInventoriesRequest} ListInventoriesRequest instance + */ + ListInventoriesRequest.create = function create(properties) { + return new ListInventoriesRequest(properties); + }; + + /** + * Encodes the specified ListInventoriesRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInventoriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListInventoriesRequest} message ListInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInventoriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListInventoriesRequest} message ListInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.ListInventoriesRequest} ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.ListInventoriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.ListInventoriesRequest} ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInventoriesRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInventoriesRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.ListInventoriesRequest} ListInventoriesRequest + */ + ListInventoriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.ListInventoriesRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.ListInventoriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "INVENTORY_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListInventoriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1alpha.ListInventoriesRequest} message ListInventoriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInventoriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.view = options.enums === String ? "INVENTORY_VIEW_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.osconfig.v1alpha.InventoryView[message.view] === undefined ? message.view : $root.google.cloud.osconfig.v1alpha.InventoryView[message.view] : message.view; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListInventoriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInventoriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInventoriesRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInventoriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.ListInventoriesRequest"; + }; + + return ListInventoriesRequest; + })(); + + v1alpha.ListInventoriesResponse = (function() { + + /** + * Properties of a ListInventoriesResponse. + * @memberof google.cloud.osconfig.v1alpha + * @interface IListInventoriesResponse + * @property {Array.|null} [inventories] ListInventoriesResponse inventories + * @property {string|null} [nextPageToken] ListInventoriesResponse nextPageToken + */ + + /** + * Constructs a new ListInventoriesResponse. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a ListInventoriesResponse. + * @implements IListInventoriesResponse + * @constructor + * @param {google.cloud.osconfig.v1alpha.IListInventoriesResponse=} [properties] Properties to set + */ + function ListInventoriesResponse(properties) { + this.inventories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInventoriesResponse inventories. + * @member {Array.} inventories + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesResponse + * @instance + */ + ListInventoriesResponse.prototype.inventories = $util.emptyArray; + + /** + * ListInventoriesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesResponse + * @instance + */ + ListInventoriesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInventoriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListInventoriesResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.ListInventoriesResponse} ListInventoriesResponse instance + */ + ListInventoriesResponse.create = function create(properties) { + return new ListInventoriesResponse(properties); + }; + + /** + * Encodes the specified ListInventoriesResponse message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInventoriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListInventoriesResponse} message ListInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inventories != null && message.inventories.length) + for (var i = 0; i < message.inventories.length; ++i) + $root.google.cloud.osconfig.v1alpha.Inventory.encode(message.inventories[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 ListInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListInventoriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListInventoriesResponse} message ListInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.ListInventoriesResponse} ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.ListInventoriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.inventories && message.inventories.length)) + message.inventories = []; + message.inventories.push($root.google.cloud.osconfig.v1alpha.Inventory.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.ListInventoriesResponse} ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInventoriesResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInventoriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inventories != null && message.hasOwnProperty("inventories")) { + if (!Array.isArray(message.inventories)) + return "inventories: array expected"; + for (var i = 0; i < message.inventories.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.Inventory.verify(message.inventories[i]); + if (error) + return "inventories." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.ListInventoriesResponse} ListInventoriesResponse + */ + ListInventoriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.ListInventoriesResponse) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.ListInventoriesResponse(); + if (object.inventories) { + if (!Array.isArray(object.inventories)) + throw TypeError(".google.cloud.osconfig.v1alpha.ListInventoriesResponse.inventories: array expected"); + message.inventories = []; + for (var i = 0; i < object.inventories.length; ++i) { + if (typeof object.inventories[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.ListInventoriesResponse.inventories: object expected"); + message.inventories[i] = $root.google.cloud.osconfig.v1alpha.Inventory.fromObject(object.inventories[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInventoriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1alpha.ListInventoriesResponse} message ListInventoriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInventoriesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inventories = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.inventories && message.inventories.length) { + object.inventories = []; + for (var j = 0; j < message.inventories.length; ++j) + object.inventories[j] = $root.google.cloud.osconfig.v1alpha.Inventory.toObject(message.inventories[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInventoriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInventoriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInventoriesResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.ListInventoriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInventoriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.ListInventoriesResponse"; + }; + + return ListInventoriesResponse; + })(); + + /** + * InventoryView enum. + * @name google.cloud.osconfig.v1alpha.InventoryView + * @enum {number} + * @property {number} INVENTORY_VIEW_UNSPECIFIED=0 INVENTORY_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1alpha.InventoryView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INVENTORY_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + v1alpha.OSPolicy = (function() { + + /** + * Properties of a OSPolicy. + * @memberof google.cloud.osconfig.v1alpha + * @interface IOSPolicy + * @property {string|null} [id] OSPolicy id + * @property {string|null} [description] OSPolicy description + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Mode|null} [mode] OSPolicy mode + * @property {Array.|null} [resourceGroups] OSPolicy resourceGroups + * @property {boolean|null} [allowNoResourceGroupMatch] OSPolicy allowNoResourceGroupMatch + */ + + /** + * Constructs a new OSPolicy. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a OSPolicy. + * @implements IOSPolicy + * @constructor + * @param {google.cloud.osconfig.v1alpha.IOSPolicy=} [properties] Properties to set + */ + function OSPolicy(properties) { + this.resourceGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicy id. + * @member {string} id + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @instance + */ + OSPolicy.prototype.id = ""; + + /** + * OSPolicy description. + * @member {string} description + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @instance + */ + OSPolicy.prototype.description = ""; + + /** + * OSPolicy mode. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Mode} mode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @instance + */ + OSPolicy.prototype.mode = 0; + + /** + * OSPolicy resourceGroups. + * @member {Array.} resourceGroups + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @instance + */ + OSPolicy.prototype.resourceGroups = $util.emptyArray; + + /** + * OSPolicy allowNoResourceGroupMatch. + * @member {boolean} allowNoResourceGroupMatch + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @instance + */ + OSPolicy.prototype.allowNoResourceGroupMatch = false; + + /** + * Creates a new OSPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicy=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy} OSPolicy instance + */ + OSPolicy.create = function create(properties) { + return new OSPolicy(properties); + }; + + /** + * Encodes the specified OSPolicy message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicy} message OSPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicy.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.mode); + if (message.resourceGroups != null && message.resourceGroups.length) + for (var i = 0; i < message.resourceGroups.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.encode(message.resourceGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allowNoResourceGroupMatch != null && Object.hasOwnProperty.call(message, "allowNoResourceGroupMatch")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowNoResourceGroupMatch); + return writer; + }; + + /** + * Encodes the specified OSPolicy message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicy} message OSPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy} OSPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.mode = reader.int32(); + break; + } + case 4: { + if (!(message.resourceGroups && message.resourceGroups.length)) + message.resourceGroups = []; + message.resourceGroups.push($root.google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.decode(reader, reader.uint32())); + break; + } + case 5: { + message.allowNoResourceGroupMatch = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy} OSPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicy message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicy.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.resourceGroups != null && message.hasOwnProperty("resourceGroups")) { + if (!Array.isArray(message.resourceGroups)) + return "resourceGroups: array expected"; + for (var i = 0; i < message.resourceGroups.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.verify(message.resourceGroups[i]); + if (error) + return "resourceGroups." + error; + } + } + if (message.allowNoResourceGroupMatch != null && message.hasOwnProperty("allowNoResourceGroupMatch")) + if (typeof message.allowNoResourceGroupMatch !== "boolean") + return "allowNoResourceGroupMatch: boolean expected"; + return null; + }; + + /** + * Creates a OSPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy} OSPolicy + */ + OSPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy(); + if (object.id != null) + message.id = String(object.id); + if (object.description != null) + message.description = String(object.description); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "VALIDATION": + case 1: + message.mode = 1; + break; + case "ENFORCEMENT": + case 2: + message.mode = 2; + break; + } + if (object.resourceGroups) { + if (!Array.isArray(object.resourceGroups)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.resourceGroups: array expected"); + message.resourceGroups = []; + for (var i = 0; i < object.resourceGroups.length; ++i) { + if (typeof object.resourceGroups[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.resourceGroups: object expected"); + message.resourceGroups[i] = $root.google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.fromObject(object.resourceGroups[i]); + } + } + if (object.allowNoResourceGroupMatch != null) + message.allowNoResourceGroupMatch = Boolean(object.allowNoResourceGroupMatch); + return message; + }; + + /** + * Creates a plain object from a OSPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy} message OSPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceGroups = []; + if (options.defaults) { + object.id = ""; + object.description = ""; + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + object.allowNoResourceGroupMatch = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicy.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.osconfig.v1alpha.OSPolicy.Mode[message.mode] : message.mode; + if (message.resourceGroups && message.resourceGroups.length) { + object.resourceGroups = []; + for (var j = 0; j < message.resourceGroups.length; ++j) + object.resourceGroups[j] = $root.google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.toObject(message.resourceGroups[j], options); + } + if (message.allowNoResourceGroupMatch != null && message.hasOwnProperty("allowNoResourceGroupMatch")) + object.allowNoResourceGroupMatch = message.allowNoResourceGroupMatch; + return object; + }; + + /** + * Converts this OSPolicy to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @instance + * @returns {Object.} JSON object + */ + OSPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicy + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy"; + }; + + /** + * Mode enum. + * @name google.cloud.osconfig.v1alpha.OSPolicy.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} VALIDATION=1 VALIDATION value + * @property {number} ENFORCEMENT=2 ENFORCEMENT value + */ + OSPolicy.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VALIDATION"] = 1; + values[valuesById[2] = "ENFORCEMENT"] = 2; + return values; + })(); + + OSPolicy.OSFilter = (function() { + + /** + * Properties of a OSFilter. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @interface IOSFilter + * @property {string|null} [osShortName] OSFilter osShortName + * @property {string|null} [osVersion] OSFilter osVersion + */ + + /** + * Constructs a new OSFilter. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @classdesc Represents a OSFilter. + * @implements IOSFilter + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IOSFilter=} [properties] Properties to set + */ + function OSFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSFilter osShortName. + * @member {string} osShortName + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.OSFilter + * @instance + */ + OSFilter.prototype.osShortName = ""; + + /** + * OSFilter osVersion. + * @member {string} osVersion + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.OSFilter + * @instance + */ + OSFilter.prototype.osVersion = ""; + + /** + * Creates a new OSFilter instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.OSFilter + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IOSFilter=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.OSFilter} OSFilter instance + */ + OSFilter.create = function create(properties) { + return new OSFilter(properties); + }; + + /** + * Encodes the specified OSFilter message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.OSFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.OSFilter + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IOSFilter} message OSFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osShortName != null && Object.hasOwnProperty.call(message, "osShortName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.osShortName); + if (message.osVersion != null && Object.hasOwnProperty.call(message, "osVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.osVersion); + return writer; + }; + + /** + * Encodes the specified OSFilter message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.OSFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.OSFilter + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IOSFilter} message OSFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.OSFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.OSFilter} OSFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.OSFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osShortName = reader.string(); + break; + } + case 2: { + message.osVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.OSFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.OSFilter} OSFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSFilter message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.OSFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osShortName != null && message.hasOwnProperty("osShortName")) + if (!$util.isString(message.osShortName)) + return "osShortName: string expected"; + if (message.osVersion != null && message.hasOwnProperty("osVersion")) + if (!$util.isString(message.osVersion)) + return "osVersion: string expected"; + return null; + }; + + /** + * Creates a OSFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.OSFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.OSFilter} OSFilter + */ + OSFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.OSFilter) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.OSFilter(); + if (object.osShortName != null) + message.osShortName = String(object.osShortName); + if (object.osVersion != null) + message.osVersion = String(object.osVersion); + return message; + }; + + /** + * Creates a plain object from a OSFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.OSFilter + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.OSFilter} message OSFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osShortName = ""; + object.osVersion = ""; + } + if (message.osShortName != null && message.hasOwnProperty("osShortName")) + object.osShortName = message.osShortName; + if (message.osVersion != null && message.hasOwnProperty("osVersion")) + object.osVersion = message.osVersion; + return object; + }; + + /** + * Converts this OSFilter to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.OSFilter + * @instance + * @returns {Object.} JSON object + */ + OSFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSFilter + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.OSFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.OSFilter"; + }; + + return OSFilter; + })(); + + OSPolicy.InventoryFilter = (function() { + + /** + * Properties of an InventoryFilter. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @interface IInventoryFilter + * @property {string|null} [osShortName] InventoryFilter osShortName + * @property {string|null} [osVersion] InventoryFilter osVersion + */ + + /** + * Constructs a new InventoryFilter. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @classdesc Represents an InventoryFilter. + * @implements IInventoryFilter + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IInventoryFilter=} [properties] Properties to set + */ + function InventoryFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InventoryFilter osShortName. + * @member {string} osShortName + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter + * @instance + */ + InventoryFilter.prototype.osShortName = ""; + + /** + * InventoryFilter osVersion. + * @member {string} osVersion + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter + * @instance + */ + InventoryFilter.prototype.osVersion = ""; + + /** + * Creates a new InventoryFilter instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IInventoryFilter=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter} InventoryFilter instance + */ + InventoryFilter.create = function create(properties) { + return new InventoryFilter(properties); + }; + + /** + * Encodes the specified InventoryFilter message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IInventoryFilter} message InventoryFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InventoryFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osShortName != null && Object.hasOwnProperty.call(message, "osShortName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.osShortName); + if (message.osVersion != null && Object.hasOwnProperty.call(message, "osVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.osVersion); + return writer; + }; + + /** + * Encodes the specified InventoryFilter message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IInventoryFilter} message InventoryFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InventoryFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InventoryFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter} InventoryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InventoryFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osShortName = reader.string(); + break; + } + case 2: { + message.osVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InventoryFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter} InventoryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InventoryFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InventoryFilter message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InventoryFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osShortName != null && message.hasOwnProperty("osShortName")) + if (!$util.isString(message.osShortName)) + return "osShortName: string expected"; + if (message.osVersion != null && message.hasOwnProperty("osVersion")) + if (!$util.isString(message.osVersion)) + return "osVersion: string expected"; + return null; + }; + + /** + * Creates an InventoryFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter} InventoryFilter + */ + InventoryFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter(); + if (object.osShortName != null) + message.osShortName = String(object.osShortName); + if (object.osVersion != null) + message.osVersion = String(object.osVersion); + return message; + }; + + /** + * Creates a plain object from an InventoryFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter} message InventoryFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InventoryFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osShortName = ""; + object.osVersion = ""; + } + if (message.osShortName != null && message.hasOwnProperty("osShortName")) + object.osShortName = message.osShortName; + if (message.osVersion != null && message.hasOwnProperty("osVersion")) + object.osVersion = message.osVersion; + return object; + }; + + /** + * Converts this InventoryFilter to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter + * @instance + * @returns {Object.} JSON object + */ + InventoryFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InventoryFilter + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InventoryFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter"; + }; + + return InventoryFilter; + })(); + + OSPolicy.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @interface IResource + * @property {string|null} [id] Resource id + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IPackageResource|null} [pkg] Resource pkg + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IRepositoryResource|null} [repository] Resource repository + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IExecResource|null} [exec] Resource exec + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFileResource|null} [file] Resource file + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IResource=} [properties] Properties to set + */ + function Resource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resource id. + * @member {string} id + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @instance + */ + Resource.prototype.id = ""; + + /** + * Resource pkg. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IPackageResource|null|undefined} pkg + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @instance + */ + Resource.prototype.pkg = null; + + /** + * Resource repository. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IRepositoryResource|null|undefined} repository + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @instance + */ + Resource.prototype.repository = null; + + /** + * Resource exec. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IExecResource|null|undefined} exec + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @instance + */ + Resource.prototype.exec = null; + + /** + * Resource file. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFileResource|null|undefined} file + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @instance + */ + Resource.prototype.file = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Resource resourceType. + * @member {"pkg"|"repository"|"exec"|"file"|undefined} resourceType + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @instance + */ + Object.defineProperty(Resource.prototype, "resourceType", { + get: $util.oneOfGetter($oneOfFields = ["pkg", "repository", "exec", "file"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IResource=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.pkg != null && Object.hasOwnProperty.call(message, "pkg")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.encode(message.pkg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.repository != null && Object.hasOwnProperty.call(message, "repository")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.encode(message.repository, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.exec != null && Object.hasOwnProperty.call(message, "exec")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.encode(message.exec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.file != null && Object.hasOwnProperty.call(message, "file")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.encode(message.file, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.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.osconfig.v1alpha.OSPolicy.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.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.osconfig.v1alpha.OSPolicy.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.pkg = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.repository = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.exec = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.decode(reader, reader.uint32()); + break; + } + case 5: { + message.file = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.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.osconfig.v1alpha.OSPolicy.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.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.osconfig.v1alpha.OSPolicy.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"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.pkg != null && message.hasOwnProperty("pkg")) { + properties.resourceType = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.verify(message.pkg); + if (error) + return "pkg." + error; + } + } + if (message.repository != null && message.hasOwnProperty("repository")) { + if (properties.resourceType === 1) + return "resourceType: multiple values"; + properties.resourceType = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.verify(message.repository); + if (error) + return "repository." + error; + } + } + if (message.exec != null && message.hasOwnProperty("exec")) { + if (properties.resourceType === 1) + return "resourceType: multiple values"; + properties.resourceType = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.verify(message.exec); + if (error) + return "exec." + error; + } + } + if (message.file != null && message.hasOwnProperty("file")) { + if (properties.resourceType === 1) + return "resourceType: multiple values"; + properties.resourceType = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.verify(message.file); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource(); + if (object.id != null) + message.id = String(object.id); + if (object.pkg != null) { + if (typeof object.pkg !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.pkg: object expected"); + message.pkg = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.fromObject(object.pkg); + } + if (object.repository != null) { + if (typeof object.repository !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.repository: object expected"); + message.repository = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.fromObject(object.repository); + } + if (object.exec != null) { + if (typeof object.exec !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.exec: object expected"); + message.exec = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.fromObject(object.exec); + } + if (object.file != null) { + if (typeof object.file !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.file: object expected"); + message.file = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.fromObject(object.file); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.pkg != null && message.hasOwnProperty("pkg")) { + object.pkg = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.toObject(message.pkg, options); + if (options.oneofs) + object.resourceType = "pkg"; + } + if (message.repository != null && message.hasOwnProperty("repository")) { + object.repository = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.toObject(message.repository, options); + if (options.oneofs) + object.resourceType = "repository"; + } + if (message.exec != null && message.hasOwnProperty("exec")) { + object.exec = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.toObject(message.exec, options); + if (options.oneofs) + object.resourceType = "exec"; + } + if (message.file != null && message.hasOwnProperty("file")) { + object.file = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.toObject(message.file, options); + if (options.oneofs) + object.resourceType = "file"; + } + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.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.osconfig.v1alpha.OSPolicy.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.osconfig.v1alpha.OSPolicy.Resource"; + }; + + Resource.File = (function() { + + /** + * Properties of a File. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @interface IFile + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IRemote|null} [remote] File remote + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IGcs|null} [gcs] File gcs + * @property {string|null} [localPath] File localPath + * @property {boolean|null} [allowInsecure] File allowInsecure + */ + + /** + * Constructs a new File. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @classdesc Represents a File. + * @implements IFile + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.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 remote. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IRemote|null|undefined} remote + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @instance + */ + File.prototype.remote = null; + + /** + * File gcs. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IGcs|null|undefined} gcs + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @instance + */ + File.prototype.gcs = null; + + /** + * File localPath. + * @member {string|null|undefined} localPath + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @instance + */ + File.prototype.localPath = null; + + /** + * File allowInsecure. + * @member {boolean} allowInsecure + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @instance + */ + File.prototype.allowInsecure = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * File type. + * @member {"remote"|"gcs"|"localPath"|undefined} type + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @instance + */ + Object.defineProperty(File.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["remote", "gcs", "localPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new File instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File} File instance + */ + File.create = function create(properties) { + return new File(properties); + }; + + /** + * Encodes the specified File message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.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.remote != null && Object.hasOwnProperty.call(message, "remote")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote.encode(message.remote, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcs != null && Object.hasOwnProperty.call(message, "gcs")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs.encode(message.gcs, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.localPath != null && Object.hasOwnProperty.call(message, "localPath")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.localPath); + if (message.allowInsecure != null && Object.hasOwnProperty.call(message, "allowInsecure")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowInsecure); + return writer; + }; + + /** + * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.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.osconfig.v1alpha.OSPolicy.Resource.File + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.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.osconfig.v1alpha.OSPolicy.Resource.File(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.remote = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote.decode(reader, reader.uint32()); + break; + } + case 2: { + message.gcs = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs.decode(reader, reader.uint32()); + break; + } + case 3: { + message.localPath = reader.string(); + break; + } + case 4: { + message.allowInsecure = reader.bool(); + 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.osconfig.v1alpha.OSPolicy.Resource.File + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.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.osconfig.v1alpha.OSPolicy.Resource.File + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + File.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.remote != null && message.hasOwnProperty("remote")) { + properties.type = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote.verify(message.remote); + if (error) + return "remote." + error; + } + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs.verify(message.gcs); + if (error) + return "gcs." + error; + } + } + if (message.localPath != null && message.hasOwnProperty("localPath")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + if (!$util.isString(message.localPath)) + return "localPath: string expected"; + } + if (message.allowInsecure != null && message.hasOwnProperty("allowInsecure")) + if (typeof message.allowInsecure !== "boolean") + return "allowInsecure: boolean expected"; + return null; + }; + + /** + * Creates a File message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File} File + */ + File.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File(); + if (object.remote != null) { + if (typeof object.remote !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.remote: object expected"); + message.remote = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote.fromObject(object.remote); + } + if (object.gcs != null) { + if (typeof object.gcs !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.gcs: object expected"); + message.gcs = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs.fromObject(object.gcs); + } + if (object.localPath != null) + message.localPath = String(object.localPath); + if (object.allowInsecure != null) + message.allowInsecure = Boolean(object.allowInsecure); + return message; + }; + + /** + * Creates a plain object from a File message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.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.allowInsecure = false; + if (message.remote != null && message.hasOwnProperty("remote")) { + object.remote = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote.toObject(message.remote, options); + if (options.oneofs) + object.type = "remote"; + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + object.gcs = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs.toObject(message.gcs, options); + if (options.oneofs) + object.type = "gcs"; + } + if (message.localPath != null && message.hasOwnProperty("localPath")) { + object.localPath = message.localPath; + if (options.oneofs) + object.type = "localPath"; + } + if (message.allowInsecure != null && message.hasOwnProperty("allowInsecure")) + object.allowInsecure = message.allowInsecure; + return object; + }; + + /** + * Converts this File to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.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.osconfig.v1alpha.OSPolicy.Resource.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.osconfig.v1alpha.OSPolicy.Resource.File"; + }; + + File.Remote = (function() { + + /** + * Properties of a Remote. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @interface IRemote + * @property {string|null} [uri] Remote uri + * @property {string|null} [sha256Checksum] Remote sha256Checksum + */ + + /** + * Constructs a new Remote. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @classdesc Represents a Remote. + * @implements IRemote + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IRemote=} [properties] Properties to set + */ + function Remote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Remote uri. + * @member {string} uri + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote + * @instance + */ + Remote.prototype.uri = ""; + + /** + * Remote sha256Checksum. + * @member {string} sha256Checksum + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote + * @instance + */ + Remote.prototype.sha256Checksum = ""; + + /** + * Creates a new Remote instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IRemote=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote} Remote instance + */ + Remote.create = function create(properties) { + return new Remote(properties); + }; + + /** + * Encodes the specified Remote message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IRemote} message Remote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Remote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.sha256Checksum != null && Object.hasOwnProperty.call(message, "sha256Checksum")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sha256Checksum); + return writer; + }; + + /** + * Encodes the specified Remote message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IRemote} message Remote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Remote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Remote message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote} Remote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Remote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.sha256Checksum = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Remote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote} Remote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Remote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Remote message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Remote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.sha256Checksum != null && message.hasOwnProperty("sha256Checksum")) + if (!$util.isString(message.sha256Checksum)) + return "sha256Checksum: string expected"; + return null; + }; + + /** + * Creates a Remote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote} Remote + */ + Remote.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.sha256Checksum != null) + message.sha256Checksum = String(object.sha256Checksum); + return message; + }; + + /** + * Creates a plain object from a Remote message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote} message Remote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Remote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.sha256Checksum = ""; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.sha256Checksum != null && message.hasOwnProperty("sha256Checksum")) + object.sha256Checksum = message.sha256Checksum; + return object; + }; + + /** + * Converts this Remote to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote + * @instance + * @returns {Object.} JSON object + */ + Remote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Remote + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Remote.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Remote"; + }; + + return Remote; + })(); + + File.Gcs = (function() { + + /** + * Properties of a Gcs. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @interface IGcs + * @property {string|null} [bucket] Gcs bucket + * @property {string|null} [object] Gcs object + * @property {number|Long|null} [generation] Gcs generation + */ + + /** + * Constructs a new Gcs. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File + * @classdesc Represents a Gcs. + * @implements IGcs + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IGcs=} [properties] Properties to set + */ + function Gcs(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Gcs bucket. + * @member {string} bucket + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs + * @instance + */ + Gcs.prototype.bucket = ""; + + /** + * Gcs object. + * @member {string} object + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs + * @instance + */ + Gcs.prototype.object = ""; + + /** + * Gcs generation. + * @member {number|Long} generation + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs + * @instance + */ + Gcs.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Gcs instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IGcs=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs} Gcs instance + */ + Gcs.create = function create(properties) { + return new Gcs(properties); + }; + + /** + * Encodes the specified Gcs message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IGcs} message Gcs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Gcs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + return writer; + }; + + /** + * Encodes the specified Gcs message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.IGcs} message Gcs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Gcs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Gcs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs} Gcs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Gcs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.object = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Gcs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs} Gcs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Gcs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Gcs message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Gcs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.object != null && message.hasOwnProperty("object")) + if (!$util.isString(message.object)) + return "object: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + return null; + }; + + /** + * Creates a Gcs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs} Gcs + */ + Gcs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.object != null) + message.object = String(object.object); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Gcs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs} message Gcs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Gcs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.object = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.object != null && message.hasOwnProperty("object")) + object.object = message.object; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + return object; + }; + + /** + * Converts this Gcs to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs + * @instance + * @returns {Object.} JSON object + */ + Gcs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Gcs + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Gcs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.Gcs"; + }; + + return Gcs; + })(); + + return File; + })(); + + Resource.PackageResource = (function() { + + /** + * Properties of a PackageResource. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @interface IPackageResource + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.DesiredState|null} [desiredState] PackageResource desiredState + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IAPT|null} [apt] PackageResource apt + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IDeb|null} [deb] PackageResource deb + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IYUM|null} [yum] PackageResource yum + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IZypper|null} [zypper] PackageResource zypper + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IRPM|null} [rpm] PackageResource rpm + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IGooGet|null} [googet] PackageResource googet + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IMSI|null} [msi] PackageResource msi + */ + + /** + * Constructs a new PackageResource. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @classdesc Represents a PackageResource. + * @implements IPackageResource + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IPackageResource=} [properties] Properties to set + */ + function PackageResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PackageResource desiredState. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.DesiredState} desiredState + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.desiredState = 0; + + /** + * PackageResource apt. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IAPT|null|undefined} apt + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.apt = null; + + /** + * PackageResource deb. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IDeb|null|undefined} deb + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.deb = null; + + /** + * PackageResource yum. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IYUM|null|undefined} yum + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.yum = null; + + /** + * PackageResource zypper. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IZypper|null|undefined} zypper + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.zypper = null; + + /** + * PackageResource rpm. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IRPM|null|undefined} rpm + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.rpm = null; + + /** + * PackageResource googet. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IGooGet|null|undefined} googet + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.googet = null; + + /** + * PackageResource msi. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IMSI|null|undefined} msi + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @instance + */ + PackageResource.prototype.msi = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PackageResource systemPackage. + * @member {"apt"|"deb"|"yum"|"zypper"|"rpm"|"googet"|"msi"|undefined} systemPackage + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @instance + */ + Object.defineProperty(PackageResource.prototype, "systemPackage", { + get: $util.oneOfGetter($oneOfFields = ["apt", "deb", "yum", "zypper", "rpm", "googet", "msi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PackageResource instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IPackageResource=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource} PackageResource instance + */ + PackageResource.create = function create(properties) { + return new PackageResource(properties); + }; + + /** + * Encodes the specified PackageResource message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IPackageResource} message PackageResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PackageResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.desiredState != null && Object.hasOwnProperty.call(message, "desiredState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.desiredState); + if (message.apt != null && Object.hasOwnProperty.call(message, "apt")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT.encode(message.apt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deb != null && Object.hasOwnProperty.call(message, "deb")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb.encode(message.deb, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.yum != null && Object.hasOwnProperty.call(message, "yum")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM.encode(message.yum, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.zypper != null && Object.hasOwnProperty.call(message, "zypper")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper.encode(message.zypper, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.rpm != null && Object.hasOwnProperty.call(message, "rpm")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM.encode(message.rpm, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.googet != null && Object.hasOwnProperty.call(message, "googet")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet.encode(message.googet, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.msi != null && Object.hasOwnProperty.call(message, "msi")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI.encode(message.msi, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PackageResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IPackageResource} message PackageResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PackageResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PackageResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource} PackageResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PackageResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.desiredState = reader.int32(); + break; + } + case 2: { + message.apt = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deb = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb.decode(reader, reader.uint32()); + break; + } + case 4: { + message.yum = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM.decode(reader, reader.uint32()); + break; + } + case 5: { + message.zypper = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper.decode(reader, reader.uint32()); + break; + } + case 6: { + message.rpm = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM.decode(reader, reader.uint32()); + break; + } + case 7: { + message.googet = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet.decode(reader, reader.uint32()); + break; + } + case 8: { + message.msi = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PackageResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource} PackageResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PackageResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PackageResource message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PackageResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.desiredState != null && message.hasOwnProperty("desiredState")) + switch (message.desiredState) { + default: + return "desiredState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.apt != null && message.hasOwnProperty("apt")) { + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT.verify(message.apt); + if (error) + return "apt." + error; + } + } + if (message.deb != null && message.hasOwnProperty("deb")) { + if (properties.systemPackage === 1) + return "systemPackage: multiple values"; + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb.verify(message.deb); + if (error) + return "deb." + error; + } + } + if (message.yum != null && message.hasOwnProperty("yum")) { + if (properties.systemPackage === 1) + return "systemPackage: multiple values"; + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM.verify(message.yum); + if (error) + return "yum." + error; + } + } + if (message.zypper != null && message.hasOwnProperty("zypper")) { + if (properties.systemPackage === 1) + return "systemPackage: multiple values"; + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper.verify(message.zypper); + if (error) + return "zypper." + error; + } + } + if (message.rpm != null && message.hasOwnProperty("rpm")) { + if (properties.systemPackage === 1) + return "systemPackage: multiple values"; + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM.verify(message.rpm); + if (error) + return "rpm." + error; + } + } + if (message.googet != null && message.hasOwnProperty("googet")) { + if (properties.systemPackage === 1) + return "systemPackage: multiple values"; + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet.verify(message.googet); + if (error) + return "googet." + error; + } + } + if (message.msi != null && message.hasOwnProperty("msi")) { + if (properties.systemPackage === 1) + return "systemPackage: multiple values"; + properties.systemPackage = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI.verify(message.msi); + if (error) + return "msi." + error; + } + } + return null; + }; + + /** + * Creates a PackageResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource} PackageResource + */ + PackageResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource(); + switch (object.desiredState) { + default: + if (typeof object.desiredState === "number") { + message.desiredState = object.desiredState; + break; + } + break; + case "DESIRED_STATE_UNSPECIFIED": + case 0: + message.desiredState = 0; + break; + case "INSTALLED": + case 1: + message.desiredState = 1; + break; + case "REMOVED": + case 2: + message.desiredState = 2; + break; + } + if (object.apt != null) { + if (typeof object.apt !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.apt: object expected"); + message.apt = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT.fromObject(object.apt); + } + if (object.deb != null) { + if (typeof object.deb !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.deb: object expected"); + message.deb = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb.fromObject(object.deb); + } + if (object.yum != null) { + if (typeof object.yum !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.yum: object expected"); + message.yum = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM.fromObject(object.yum); + } + if (object.zypper != null) { + if (typeof object.zypper !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.zypper: object expected"); + message.zypper = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper.fromObject(object.zypper); + } + if (object.rpm != null) { + if (typeof object.rpm !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.rpm: object expected"); + message.rpm = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM.fromObject(object.rpm); + } + if (object.googet != null) { + if (typeof object.googet !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.googet: object expected"); + message.googet = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet.fromObject(object.googet); + } + if (object.msi != null) { + if (typeof object.msi !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.msi: object expected"); + message.msi = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI.fromObject(object.msi); + } + return message; + }; + + /** + * Creates a plain object from a PackageResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource} message PackageResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PackageResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.desiredState = options.enums === String ? "DESIRED_STATE_UNSPECIFIED" : 0; + if (message.desiredState != null && message.hasOwnProperty("desiredState")) + object.desiredState = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.DesiredState[message.desiredState] === undefined ? message.desiredState : $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.DesiredState[message.desiredState] : message.desiredState; + if (message.apt != null && message.hasOwnProperty("apt")) { + object.apt = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT.toObject(message.apt, options); + if (options.oneofs) + object.systemPackage = "apt"; + } + if (message.deb != null && message.hasOwnProperty("deb")) { + object.deb = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb.toObject(message.deb, options); + if (options.oneofs) + object.systemPackage = "deb"; + } + if (message.yum != null && message.hasOwnProperty("yum")) { + object.yum = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM.toObject(message.yum, options); + if (options.oneofs) + object.systemPackage = "yum"; + } + if (message.zypper != null && message.hasOwnProperty("zypper")) { + object.zypper = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper.toObject(message.zypper, options); + if (options.oneofs) + object.systemPackage = "zypper"; + } + if (message.rpm != null && message.hasOwnProperty("rpm")) { + object.rpm = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM.toObject(message.rpm, options); + if (options.oneofs) + object.systemPackage = "rpm"; + } + if (message.googet != null && message.hasOwnProperty("googet")) { + object.googet = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet.toObject(message.googet, options); + if (options.oneofs) + object.systemPackage = "googet"; + } + if (message.msi != null && message.hasOwnProperty("msi")) { + object.msi = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI.toObject(message.msi, options); + if (options.oneofs) + object.systemPackage = "msi"; + } + return object; + }; + + /** + * Converts this PackageResource to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @instance + * @returns {Object.} JSON object + */ + PackageResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PackageResource + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PackageResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource"; + }; + + /** + * DesiredState enum. + * @name google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.DesiredState + * @enum {number} + * @property {number} DESIRED_STATE_UNSPECIFIED=0 DESIRED_STATE_UNSPECIFIED value + * @property {number} INSTALLED=1 INSTALLED value + * @property {number} REMOVED=2 REMOVED value + */ + PackageResource.DesiredState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DESIRED_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTALLED"] = 1; + values[valuesById[2] = "REMOVED"] = 2; + return values; + })(); + + PackageResource.Deb = (function() { + + /** + * Properties of a Deb. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @interface IDeb + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null} [source] Deb source + * @property {boolean|null} [pullDeps] Deb pullDeps + */ + + /** + * Constructs a new Deb. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @classdesc Represents a Deb. + * @implements IDeb + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IDeb=} [properties] Properties to set + */ + function Deb(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deb source. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null|undefined} source + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb + * @instance + */ + Deb.prototype.source = null; + + /** + * Deb pullDeps. + * @member {boolean} pullDeps + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb + * @instance + */ + Deb.prototype.pullDeps = false; + + /** + * Creates a new Deb instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IDeb=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb} Deb instance + */ + Deb.create = function create(properties) { + return new Deb(properties); + }; + + /** + * Encodes the specified Deb message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IDeb} message Deb message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deb.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pullDeps != null && Object.hasOwnProperty.call(message, "pullDeps")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.pullDeps); + return writer; + }; + + /** + * Encodes the specified Deb message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IDeb} message Deb message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deb.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deb message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb} Deb + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deb.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pullDeps = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deb message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb} Deb + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deb.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deb message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deb.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.osconfig.v1alpha.OSPolicy.Resource.File.verify(message.source); + if (error) + return "source." + error; + } + if (message.pullDeps != null && message.hasOwnProperty("pullDeps")) + if (typeof message.pullDeps !== "boolean") + return "pullDeps: boolean expected"; + return null; + }; + + /** + * Creates a Deb message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb} Deb + */ + Deb.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb.source: object expected"); + message.source = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.fromObject(object.source); + } + if (object.pullDeps != null) + message.pullDeps = Boolean(object.pullDeps); + return message; + }; + + /** + * Creates a plain object from a Deb message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb} message Deb + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deb.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.pullDeps = false; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.toObject(message.source, options); + if (message.pullDeps != null && message.hasOwnProperty("pullDeps")) + object.pullDeps = message.pullDeps; + return object; + }; + + /** + * Converts this Deb to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb + * @instance + * @returns {Object.} JSON object + */ + Deb.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deb + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deb.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Deb"; + }; + + return Deb; + })(); + + PackageResource.APT = (function() { + + /** + * Properties of a APT. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @interface IAPT + * @property {string|null} [name] APT name + */ + + /** + * Constructs a new APT. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @classdesc Represents a APT. + * @implements IAPT + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IAPT=} [properties] Properties to set + */ + function APT(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * APT name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT + * @instance + */ + APT.prototype.name = ""; + + /** + * Creates a new APT instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IAPT=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT} APT instance + */ + APT.create = function create(properties) { + return new APT(properties); + }; + + /** + * Encodes the specified APT message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IAPT} message APT message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + APT.encode = function encode(message, writer) { + 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 APT message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IAPT} message APT message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + APT.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a APT message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT} APT + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + APT.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT(); + 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 APT message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT} APT + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + APT.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a APT message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + APT.verify = function verify(message) { + if (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 APT message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT} APT + */ + APT.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a APT message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT} message APT + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + APT.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 APT to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT + * @instance + * @returns {Object.} JSON object + */ + APT.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for APT + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + APT.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.APT"; + }; + + return APT; + })(); + + PackageResource.RPM = (function() { + + /** + * Properties of a RPM. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @interface IRPM + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null} [source] RPM source + * @property {boolean|null} [pullDeps] RPM pullDeps + */ + + /** + * Constructs a new RPM. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @classdesc Represents a RPM. + * @implements IRPM + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IRPM=} [properties] Properties to set + */ + function RPM(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RPM source. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null|undefined} source + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM + * @instance + */ + RPM.prototype.source = null; + + /** + * RPM pullDeps. + * @member {boolean} pullDeps + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM + * @instance + */ + RPM.prototype.pullDeps = false; + + /** + * Creates a new RPM instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IRPM=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM} RPM instance + */ + RPM.create = function create(properties) { + return new RPM(properties); + }; + + /** + * Encodes the specified RPM message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IRPM} message RPM message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RPM.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pullDeps != null && Object.hasOwnProperty.call(message, "pullDeps")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.pullDeps); + return writer; + }; + + /** + * Encodes the specified RPM message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IRPM} message RPM message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RPM.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RPM message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM} RPM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RPM.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pullDeps = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RPM message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM} RPM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RPM.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RPM message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RPM.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.osconfig.v1alpha.OSPolicy.Resource.File.verify(message.source); + if (error) + return "source." + error; + } + if (message.pullDeps != null && message.hasOwnProperty("pullDeps")) + if (typeof message.pullDeps !== "boolean") + return "pullDeps: boolean expected"; + return null; + }; + + /** + * Creates a RPM message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM} RPM + */ + RPM.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM.source: object expected"); + message.source = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.fromObject(object.source); + } + if (object.pullDeps != null) + message.pullDeps = Boolean(object.pullDeps); + return message; + }; + + /** + * Creates a plain object from a RPM message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM} message RPM + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RPM.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.pullDeps = false; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.toObject(message.source, options); + if (message.pullDeps != null && message.hasOwnProperty("pullDeps")) + object.pullDeps = message.pullDeps; + return object; + }; + + /** + * Converts this RPM to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM + * @instance + * @returns {Object.} JSON object + */ + RPM.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RPM + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RPM.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.RPM"; + }; + + return RPM; + })(); + + PackageResource.YUM = (function() { + + /** + * Properties of a YUM. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @interface IYUM + * @property {string|null} [name] YUM name + */ + + /** + * Constructs a new YUM. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @classdesc Represents a YUM. + * @implements IYUM + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IYUM=} [properties] Properties to set + */ + function YUM(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * YUM name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM + * @instance + */ + YUM.prototype.name = ""; + + /** + * Creates a new YUM instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IYUM=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM} YUM instance + */ + YUM.create = function create(properties) { + return new YUM(properties); + }; + + /** + * Encodes the specified YUM message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IYUM} message YUM message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YUM.encode = function encode(message, writer) { + 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 YUM message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IYUM} message YUM message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YUM.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a YUM message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM} YUM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YUM.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM(); + 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 YUM message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM} YUM + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YUM.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a YUM message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + YUM.verify = function verify(message) { + if (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 YUM message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM} YUM + */ + YUM.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a YUM message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM} message YUM + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + YUM.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 YUM to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM + * @instance + * @returns {Object.} JSON object + */ + YUM.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for YUM + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + YUM.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.YUM"; + }; + + return YUM; + })(); + + PackageResource.Zypper = (function() { + + /** + * Properties of a Zypper. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @interface IZypper + * @property {string|null} [name] Zypper name + */ + + /** + * Constructs a new Zypper. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @classdesc Represents a Zypper. + * @implements IZypper + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IZypper=} [properties] Properties to set + */ + function Zypper(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Zypper name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper + * @instance + */ + Zypper.prototype.name = ""; + + /** + * Creates a new Zypper instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IZypper=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper} Zypper instance + */ + Zypper.create = function create(properties) { + return new Zypper(properties); + }; + + /** + * Encodes the specified Zypper message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IZypper} message Zypper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Zypper.encode = function encode(message, writer) { + 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 Zypper message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IZypper} message Zypper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Zypper.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Zypper message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper} Zypper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Zypper.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper(); + 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 Zypper message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper} Zypper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Zypper.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Zypper message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Zypper.verify = function verify(message) { + if (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 Zypper message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper} Zypper + */ + Zypper.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Zypper message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper} message Zypper + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Zypper.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 Zypper to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper + * @instance + * @returns {Object.} JSON object + */ + Zypper.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Zypper + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Zypper.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.Zypper"; + }; + + return Zypper; + })(); + + PackageResource.GooGet = (function() { + + /** + * Properties of a GooGet. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @interface IGooGet + * @property {string|null} [name] GooGet name + */ + + /** + * Constructs a new GooGet. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @classdesc Represents a GooGet. + * @implements IGooGet + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IGooGet=} [properties] Properties to set + */ + function GooGet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GooGet name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet + * @instance + */ + GooGet.prototype.name = ""; + + /** + * Creates a new GooGet instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IGooGet=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet} GooGet instance + */ + GooGet.create = function create(properties) { + return new GooGet(properties); + }; + + /** + * Encodes the specified GooGet message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IGooGet} message GooGet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GooGet.encode = function encode(message, writer) { + 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 GooGet message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IGooGet} message GooGet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GooGet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GooGet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet} GooGet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GooGet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet(); + 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 GooGet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet} GooGet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GooGet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GooGet message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GooGet.verify = function verify(message) { + if (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 GooGet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet} GooGet + */ + GooGet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GooGet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet} message GooGet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GooGet.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 GooGet to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet + * @instance + * @returns {Object.} JSON object + */ + GooGet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GooGet + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GooGet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.GooGet"; + }; + + return GooGet; + })(); + + PackageResource.MSI = (function() { + + /** + * Properties of a MSI. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @interface IMSI + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null} [source] MSI source + * @property {Array.|null} [properties] MSI properties + */ + + /** + * Constructs a new MSI. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource + * @classdesc Represents a MSI. + * @implements IMSI + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IMSI=} [properties] Properties to set + */ + function MSI(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]]; + } + + /** + * MSI source. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null|undefined} source + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI + * @instance + */ + MSI.prototype.source = null; + + /** + * MSI properties. + * @member {Array.} properties + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI + * @instance + */ + MSI.prototype.properties = $util.emptyArray; + + /** + * Creates a new MSI instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IMSI=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI} MSI instance + */ + MSI.create = function create(properties) { + return new MSI(properties); + }; + + /** + * Encodes the specified MSI message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IMSI} message MSI message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MSI.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.properties[i]); + return writer; + }; + + /** + * Encodes the specified MSI message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.IMSI} message MSI message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MSI.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MSI message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI} MSI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MSI.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MSI message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI} MSI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MSI.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MSI message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MSI.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.osconfig.v1alpha.OSPolicy.Resource.File.verify(message.source); + if (error) + return "source." + error; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!Array.isArray(message.properties)) + return "properties: array expected"; + for (var i = 0; i < message.properties.length; ++i) + if (!$util.isString(message.properties[i])) + return "properties: string[] expected"; + } + return null; + }; + + /** + * Creates a MSI message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI} MSI + */ + MSI.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI.source: object expected"); + message.source = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.fromObject(object.source); + } + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI.properties: array expected"); + message.properties = []; + for (var i = 0; i < object.properties.length; ++i) + message.properties[i] = String(object.properties[i]); + } + return message; + }; + + /** + * Creates a plain object from a MSI message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI} message MSI + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MSI.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.properties = []; + if (options.defaults) + object.source = null; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.toObject(message.source, options); + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = message.properties[j]; + } + return object; + }; + + /** + * Converts this MSI to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI + * @instance + * @returns {Object.} JSON object + */ + MSI.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MSI + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MSI.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.PackageResource.MSI"; + }; + + return MSI; + })(); + + return PackageResource; + })(); + + Resource.RepositoryResource = (function() { + + /** + * Properties of a RepositoryResource. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @interface IRepositoryResource + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IAptRepository|null} [apt] RepositoryResource apt + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IYumRepository|null} [yum] RepositoryResource yum + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IZypperRepository|null} [zypper] RepositoryResource zypper + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IGooRepository|null} [goo] RepositoryResource goo + */ + + /** + * Constructs a new RepositoryResource. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @classdesc Represents a RepositoryResource. + * @implements IRepositoryResource + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IRepositoryResource=} [properties] Properties to set + */ + function RepositoryResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RepositoryResource apt. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IAptRepository|null|undefined} apt + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @instance + */ + RepositoryResource.prototype.apt = null; + + /** + * RepositoryResource yum. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IYumRepository|null|undefined} yum + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @instance + */ + RepositoryResource.prototype.yum = null; + + /** + * RepositoryResource zypper. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IZypperRepository|null|undefined} zypper + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @instance + */ + RepositoryResource.prototype.zypper = null; + + /** + * RepositoryResource goo. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IGooRepository|null|undefined} goo + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @instance + */ + RepositoryResource.prototype.goo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RepositoryResource repository. + * @member {"apt"|"yum"|"zypper"|"goo"|undefined} repository + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @instance + */ + Object.defineProperty(RepositoryResource.prototype, "repository", { + get: $util.oneOfGetter($oneOfFields = ["apt", "yum", "zypper", "goo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RepositoryResource instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IRepositoryResource=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource} RepositoryResource instance + */ + RepositoryResource.create = function create(properties) { + return new RepositoryResource(properties); + }; + + /** + * Encodes the specified RepositoryResource message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IRepositoryResource} message RepositoryResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepositoryResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apt != null && Object.hasOwnProperty.call(message, "apt")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.encode(message.apt, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.yum != null && Object.hasOwnProperty.call(message, "yum")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository.encode(message.yum, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.zypper != null && Object.hasOwnProperty.call(message, "zypper")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository.encode(message.zypper, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.goo != null && Object.hasOwnProperty.call(message, "goo")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository.encode(message.goo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RepositoryResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IRepositoryResource} message RepositoryResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepositoryResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RepositoryResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource} RepositoryResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepositoryResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apt = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.decode(reader, reader.uint32()); + break; + } + case 2: { + message.yum = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository.decode(reader, reader.uint32()); + break; + } + case 3: { + message.zypper = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository.decode(reader, reader.uint32()); + break; + } + case 4: { + message.goo = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RepositoryResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource} RepositoryResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepositoryResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RepositoryResource message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RepositoryResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.apt != null && message.hasOwnProperty("apt")) { + properties.repository = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.verify(message.apt); + if (error) + return "apt." + error; + } + } + if (message.yum != null && message.hasOwnProperty("yum")) { + if (properties.repository === 1) + return "repository: multiple values"; + properties.repository = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository.verify(message.yum); + if (error) + return "yum." + error; + } + } + if (message.zypper != null && message.hasOwnProperty("zypper")) { + if (properties.repository === 1) + return "repository: multiple values"; + properties.repository = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository.verify(message.zypper); + if (error) + return "zypper." + error; + } + } + if (message.goo != null && message.hasOwnProperty("goo")) { + if (properties.repository === 1) + return "repository: multiple values"; + properties.repository = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository.verify(message.goo); + if (error) + return "goo." + error; + } + } + return null; + }; + + /** + * Creates a RepositoryResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource} RepositoryResource + */ + RepositoryResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource(); + if (object.apt != null) { + if (typeof object.apt !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.apt: object expected"); + message.apt = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.fromObject(object.apt); + } + if (object.yum != null) { + if (typeof object.yum !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.yum: object expected"); + message.yum = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository.fromObject(object.yum); + } + if (object.zypper != null) { + if (typeof object.zypper !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.zypper: object expected"); + message.zypper = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository.fromObject(object.zypper); + } + if (object.goo != null) { + if (typeof object.goo !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.goo: object expected"); + message.goo = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository.fromObject(object.goo); + } + return message; + }; + + /** + * Creates a plain object from a RepositoryResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource} message RepositoryResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RepositoryResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.apt != null && message.hasOwnProperty("apt")) { + object.apt = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.toObject(message.apt, options); + if (options.oneofs) + object.repository = "apt"; + } + if (message.yum != null && message.hasOwnProperty("yum")) { + object.yum = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository.toObject(message.yum, options); + if (options.oneofs) + object.repository = "yum"; + } + if (message.zypper != null && message.hasOwnProperty("zypper")) { + object.zypper = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository.toObject(message.zypper, options); + if (options.oneofs) + object.repository = "zypper"; + } + if (message.goo != null && message.hasOwnProperty("goo")) { + object.goo = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository.toObject(message.goo, options); + if (options.oneofs) + object.repository = "goo"; + } + return object; + }; + + /** + * Converts this RepositoryResource to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @instance + * @returns {Object.} JSON object + */ + RepositoryResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RepositoryResource + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RepositoryResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource"; + }; + + RepositoryResource.AptRepository = (function() { + + /** + * Properties of an AptRepository. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @interface IAptRepository + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType|null} [archiveType] AptRepository archiveType + * @property {string|null} [uri] AptRepository uri + * @property {string|null} [distribution] AptRepository distribution + * @property {Array.|null} [components] AptRepository components + * @property {string|null} [gpgKey] AptRepository gpgKey + */ + + /** + * Constructs a new AptRepository. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @classdesc Represents an AptRepository. + * @implements IAptRepository + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IAptRepository=} [properties] Properties to set + */ + function AptRepository(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]]; + } + + /** + * AptRepository archiveType. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType} archiveType + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @instance + */ + AptRepository.prototype.archiveType = 0; + + /** + * AptRepository uri. + * @member {string} uri + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @instance + */ + AptRepository.prototype.uri = ""; + + /** + * AptRepository distribution. + * @member {string} distribution + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @instance + */ + AptRepository.prototype.distribution = ""; + + /** + * AptRepository components. + * @member {Array.} components + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @instance + */ + AptRepository.prototype.components = $util.emptyArray; + + /** + * AptRepository gpgKey. + * @member {string} gpgKey + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @instance + */ + AptRepository.prototype.gpgKey = ""; + + /** + * Creates a new AptRepository instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IAptRepository=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository} AptRepository instance + */ + AptRepository.create = function create(properties) { + return new AptRepository(properties); + }; + + /** + * Encodes the specified AptRepository message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IAptRepository} message AptRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AptRepository.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.archiveType != null && Object.hasOwnProperty.call(message, "archiveType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.archiveType); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.distribution != null && Object.hasOwnProperty.call(message, "distribution")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.distribution); + if (message.components != null && message.components.length) + for (var i = 0; i < message.components.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.components[i]); + if (message.gpgKey != null && Object.hasOwnProperty.call(message, "gpgKey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.gpgKey); + return writer; + }; + + /** + * Encodes the specified AptRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IAptRepository} message AptRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AptRepository.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AptRepository message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository} AptRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AptRepository.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.archiveType = reader.int32(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + case 3: { + message.distribution = reader.string(); + break; + } + case 4: { + if (!(message.components && message.components.length)) + message.components = []; + message.components.push(reader.string()); + break; + } + case 5: { + message.gpgKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AptRepository message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository} AptRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AptRepository.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AptRepository message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AptRepository.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.archiveType != null && message.hasOwnProperty("archiveType")) + switch (message.archiveType) { + default: + return "archiveType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.distribution != null && message.hasOwnProperty("distribution")) + if (!$util.isString(message.distribution)) + return "distribution: 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"; + } + if (message.gpgKey != null && message.hasOwnProperty("gpgKey")) + if (!$util.isString(message.gpgKey)) + return "gpgKey: string expected"; + return null; + }; + + /** + * Creates an AptRepository message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository} AptRepository + */ + AptRepository.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository(); + switch (object.archiveType) { + default: + if (typeof object.archiveType === "number") { + message.archiveType = object.archiveType; + break; + } + break; + case "ARCHIVE_TYPE_UNSPECIFIED": + case 0: + message.archiveType = 0; + break; + case "DEB": + case 1: + message.archiveType = 1; + break; + case "DEB_SRC": + case 2: + message.archiveType = 2; + break; + } + if (object.uri != null) + message.uri = String(object.uri); + if (object.distribution != null) + message.distribution = String(object.distribution); + if (object.components) { + if (!Array.isArray(object.components)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.components: array expected"); + message.components = []; + for (var i = 0; i < object.components.length; ++i) + message.components[i] = String(object.components[i]); + } + if (object.gpgKey != null) + message.gpgKey = String(object.gpgKey); + return message; + }; + + /** + * Creates a plain object from an AptRepository message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository} message AptRepository + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AptRepository.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.components = []; + if (options.defaults) { + object.archiveType = options.enums === String ? "ARCHIVE_TYPE_UNSPECIFIED" : 0; + object.uri = ""; + object.distribution = ""; + object.gpgKey = ""; + } + if (message.archiveType != null && message.hasOwnProperty("archiveType")) + object.archiveType = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType[message.archiveType] === undefined ? message.archiveType : $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType[message.archiveType] : message.archiveType; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.distribution != null && message.hasOwnProperty("distribution")) + object.distribution = message.distribution; + if (message.components && message.components.length) { + object.components = []; + for (var j = 0; j < message.components.length; ++j) + object.components[j] = message.components[j]; + } + if (message.gpgKey != null && message.hasOwnProperty("gpgKey")) + object.gpgKey = message.gpgKey; + return object; + }; + + /** + * Converts this AptRepository to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @instance + * @returns {Object.} JSON object + */ + AptRepository.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AptRepository + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AptRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository"; + }; + + /** + * ArchiveType enum. + * @name google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType + * @enum {number} + * @property {number} ARCHIVE_TYPE_UNSPECIFIED=0 ARCHIVE_TYPE_UNSPECIFIED value + * @property {number} DEB=1 DEB value + * @property {number} DEB_SRC=2 DEB_SRC value + */ + AptRepository.ArchiveType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ARCHIVE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEB"] = 1; + values[valuesById[2] = "DEB_SRC"] = 2; + return values; + })(); + + return AptRepository; + })(); + + RepositoryResource.YumRepository = (function() { + + /** + * Properties of a YumRepository. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @interface IYumRepository + * @property {string|null} [id] YumRepository id + * @property {string|null} [displayName] YumRepository displayName + * @property {string|null} [baseUrl] YumRepository baseUrl + * @property {Array.|null} [gpgKeys] YumRepository gpgKeys + */ + + /** + * Constructs a new YumRepository. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @classdesc Represents a YumRepository. + * @implements IYumRepository + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IYumRepository=} [properties] Properties to set + */ + function YumRepository(properties) { + this.gpgKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * YumRepository id. + * @member {string} id + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @instance + */ + YumRepository.prototype.id = ""; + + /** + * YumRepository displayName. + * @member {string} displayName + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @instance + */ + YumRepository.prototype.displayName = ""; + + /** + * YumRepository baseUrl. + * @member {string} baseUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @instance + */ + YumRepository.prototype.baseUrl = ""; + + /** + * YumRepository gpgKeys. + * @member {Array.} gpgKeys + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @instance + */ + YumRepository.prototype.gpgKeys = $util.emptyArray; + + /** + * Creates a new YumRepository instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IYumRepository=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository} YumRepository instance + */ + YumRepository.create = function create(properties) { + return new YumRepository(properties); + }; + + /** + * Encodes the specified YumRepository message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IYumRepository} message YumRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YumRepository.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.baseUrl != null && Object.hasOwnProperty.call(message, "baseUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.baseUrl); + if (message.gpgKeys != null && message.gpgKeys.length) + for (var i = 0; i < message.gpgKeys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.gpgKeys[i]); + return writer; + }; + + /** + * Encodes the specified YumRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IYumRepository} message YumRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YumRepository.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a YumRepository message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository} YumRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YumRepository.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.baseUrl = reader.string(); + break; + } + case 4: { + if (!(message.gpgKeys && message.gpgKeys.length)) + message.gpgKeys = []; + message.gpgKeys.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a YumRepository message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository} YumRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YumRepository.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a YumRepository message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + YumRepository.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.baseUrl != null && message.hasOwnProperty("baseUrl")) + if (!$util.isString(message.baseUrl)) + return "baseUrl: string expected"; + if (message.gpgKeys != null && message.hasOwnProperty("gpgKeys")) { + if (!Array.isArray(message.gpgKeys)) + return "gpgKeys: array expected"; + for (var i = 0; i < message.gpgKeys.length; ++i) + if (!$util.isString(message.gpgKeys[i])) + return "gpgKeys: string[] expected"; + } + return null; + }; + + /** + * Creates a YumRepository message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository} YumRepository + */ + YumRepository.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.baseUrl != null) + message.baseUrl = String(object.baseUrl); + if (object.gpgKeys) { + if (!Array.isArray(object.gpgKeys)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository.gpgKeys: array expected"); + message.gpgKeys = []; + for (var i = 0; i < object.gpgKeys.length; ++i) + message.gpgKeys[i] = String(object.gpgKeys[i]); + } + return message; + }; + + /** + * Creates a plain object from a YumRepository message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository} message YumRepository + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + YumRepository.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.gpgKeys = []; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + object.baseUrl = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.baseUrl != null && message.hasOwnProperty("baseUrl")) + object.baseUrl = message.baseUrl; + if (message.gpgKeys && message.gpgKeys.length) { + object.gpgKeys = []; + for (var j = 0; j < message.gpgKeys.length; ++j) + object.gpgKeys[j] = message.gpgKeys[j]; + } + return object; + }; + + /** + * Converts this YumRepository to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @instance + * @returns {Object.} JSON object + */ + YumRepository.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for YumRepository + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + YumRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.YumRepository"; + }; + + return YumRepository; + })(); + + RepositoryResource.ZypperRepository = (function() { + + /** + * Properties of a ZypperRepository. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @interface IZypperRepository + * @property {string|null} [id] ZypperRepository id + * @property {string|null} [displayName] ZypperRepository displayName + * @property {string|null} [baseUrl] ZypperRepository baseUrl + * @property {Array.|null} [gpgKeys] ZypperRepository gpgKeys + */ + + /** + * Constructs a new ZypperRepository. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @classdesc Represents a ZypperRepository. + * @implements IZypperRepository + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IZypperRepository=} [properties] Properties to set + */ + function ZypperRepository(properties) { + this.gpgKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ZypperRepository id. + * @member {string} id + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @instance + */ + ZypperRepository.prototype.id = ""; + + /** + * ZypperRepository displayName. + * @member {string} displayName + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @instance + */ + ZypperRepository.prototype.displayName = ""; + + /** + * ZypperRepository baseUrl. + * @member {string} baseUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @instance + */ + ZypperRepository.prototype.baseUrl = ""; + + /** + * ZypperRepository gpgKeys. + * @member {Array.} gpgKeys + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @instance + */ + ZypperRepository.prototype.gpgKeys = $util.emptyArray; + + /** + * Creates a new ZypperRepository instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IZypperRepository=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository} ZypperRepository instance + */ + ZypperRepository.create = function create(properties) { + return new ZypperRepository(properties); + }; + + /** + * Encodes the specified ZypperRepository message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IZypperRepository} message ZypperRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperRepository.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.baseUrl != null && Object.hasOwnProperty.call(message, "baseUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.baseUrl); + if (message.gpgKeys != null && message.gpgKeys.length) + for (var i = 0; i < message.gpgKeys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.gpgKeys[i]); + return writer; + }; + + /** + * Encodes the specified ZypperRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IZypperRepository} message ZypperRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperRepository.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZypperRepository message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository} ZypperRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperRepository.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.baseUrl = reader.string(); + break; + } + case 4: { + if (!(message.gpgKeys && message.gpgKeys.length)) + message.gpgKeys = []; + message.gpgKeys.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZypperRepository message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository} ZypperRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperRepository.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZypperRepository message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZypperRepository.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.baseUrl != null && message.hasOwnProperty("baseUrl")) + if (!$util.isString(message.baseUrl)) + return "baseUrl: string expected"; + if (message.gpgKeys != null && message.hasOwnProperty("gpgKeys")) { + if (!Array.isArray(message.gpgKeys)) + return "gpgKeys: array expected"; + for (var i = 0; i < message.gpgKeys.length; ++i) + if (!$util.isString(message.gpgKeys[i])) + return "gpgKeys: string[] expected"; + } + return null; + }; + + /** + * Creates a ZypperRepository message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository} ZypperRepository + */ + ZypperRepository.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.baseUrl != null) + message.baseUrl = String(object.baseUrl); + if (object.gpgKeys) { + if (!Array.isArray(object.gpgKeys)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository.gpgKeys: array expected"); + message.gpgKeys = []; + for (var i = 0; i < object.gpgKeys.length; ++i) + message.gpgKeys[i] = String(object.gpgKeys[i]); + } + return message; + }; + + /** + * Creates a plain object from a ZypperRepository message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository} message ZypperRepository + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZypperRepository.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.gpgKeys = []; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + object.baseUrl = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.baseUrl != null && message.hasOwnProperty("baseUrl")) + object.baseUrl = message.baseUrl; + if (message.gpgKeys && message.gpgKeys.length) { + object.gpgKeys = []; + for (var j = 0; j < message.gpgKeys.length; ++j) + object.gpgKeys[j] = message.gpgKeys[j]; + } + return object; + }; + + /** + * Converts this ZypperRepository to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @instance + * @returns {Object.} JSON object + */ + ZypperRepository.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ZypperRepository + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ZypperRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.ZypperRepository"; + }; + + return ZypperRepository; + })(); + + RepositoryResource.GooRepository = (function() { + + /** + * Properties of a GooRepository. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @interface IGooRepository + * @property {string|null} [name] GooRepository name + * @property {string|null} [url] GooRepository url + */ + + /** + * Constructs a new GooRepository. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource + * @classdesc Represents a GooRepository. + * @implements IGooRepository + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IGooRepository=} [properties] Properties to set + */ + function GooRepository(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GooRepository name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository + * @instance + */ + GooRepository.prototype.name = ""; + + /** + * GooRepository url. + * @member {string} url + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository + * @instance + */ + GooRepository.prototype.url = ""; + + /** + * Creates a new GooRepository instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IGooRepository=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository} GooRepository instance + */ + GooRepository.create = function create(properties) { + return new GooRepository(properties); + }; + + /** + * Encodes the specified GooRepository message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IGooRepository} message GooRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GooRepository.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); + return writer; + }; + + /** + * Encodes the specified GooRepository message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.IGooRepository} message GooRepository message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GooRepository.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GooRepository message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository} GooRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GooRepository.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GooRepository message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository} GooRepository + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GooRepository.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GooRepository message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GooRepository.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates a GooRepository message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository} GooRepository + */ + GooRepository.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository(); + if (object.name != null) + message.name = String(object.name); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from a GooRepository message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository} message GooRepository + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GooRepository.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.url = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this GooRepository to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository + * @instance + * @returns {Object.} JSON object + */ + GooRepository.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GooRepository + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GooRepository.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.RepositoryResource.GooRepository"; + }; + + return GooRepository; + })(); + + return RepositoryResource; + })(); + + Resource.ExecResource = (function() { + + /** + * Properties of an ExecResource. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @interface IExecResource + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec|null} [validate] ExecResource validate + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec|null} [enforce] ExecResource enforce + */ + + /** + * Constructs a new ExecResource. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @classdesc Represents an ExecResource. + * @implements IExecResource + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IExecResource=} [properties] Properties to set + */ + function ExecResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecResource validate. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec|null|undefined} validate + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @instance + */ + ExecResource.prototype.validate = null; + + /** + * ExecResource enforce. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec|null|undefined} enforce + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @instance + */ + ExecResource.prototype.enforce = null; + + /** + * Creates a new ExecResource instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IExecResource=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource} ExecResource instance + */ + ExecResource.create = function create(properties) { + return new ExecResource(properties); + }; + + /** + * Encodes the specified ExecResource message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IExecResource} message ExecResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validate != null && Object.hasOwnProperty.call(message, "validate")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.encode(message.validate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enforce != null && Object.hasOwnProperty.call(message, "enforce")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.encode(message.enforce, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IExecResource} message ExecResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource} ExecResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.validate = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.enforce = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource} ExecResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecResource message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validate != null && message.hasOwnProperty("validate")) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.verify(message.validate); + if (error) + return "validate." + error; + } + if (message.enforce != null && message.hasOwnProperty("enforce")) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.verify(message.enforce); + if (error) + return "enforce." + error; + } + return null; + }; + + /** + * Creates an ExecResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource} ExecResource + */ + ExecResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource(); + if (object.validate != null) { + if (typeof object.validate !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.validate: object expected"); + message.validate = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.fromObject(object.validate); + } + if (object.enforce != null) { + if (typeof object.enforce !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.enforce: object expected"); + message.enforce = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.fromObject(object.enforce); + } + return message; + }; + + /** + * Creates a plain object from an ExecResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource} message ExecResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.validate = null; + object.enforce = null; + } + if (message.validate != null && message.hasOwnProperty("validate")) + object.validate = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.toObject(message.validate, options); + if (message.enforce != null && message.hasOwnProperty("enforce")) + object.enforce = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.toObject(message.enforce, options); + return object; + }; + + /** + * Converts this ExecResource to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @instance + * @returns {Object.} JSON object + */ + ExecResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecResource + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource"; + }; + + ExecResource.Exec = (function() { + + /** + * Properties of an Exec. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @interface IExec + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null} [file] Exec file + * @property {string|null} [script] Exec script + * @property {Array.|null} [args] Exec args + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.Interpreter|null} [interpreter] Exec interpreter + * @property {string|null} [outputFilePath] Exec outputFilePath + */ + + /** + * Constructs a new Exec. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource + * @classdesc Represents an Exec. + * @implements IExec + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec=} [properties] Properties to set + */ + function Exec(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Exec file. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null|undefined} file + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @instance + */ + Exec.prototype.file = null; + + /** + * Exec script. + * @member {string|null|undefined} script + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @instance + */ + Exec.prototype.script = null; + + /** + * Exec args. + * @member {Array.} args + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @instance + */ + Exec.prototype.args = $util.emptyArray; + + /** + * Exec interpreter. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.Interpreter} interpreter + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @instance + */ + Exec.prototype.interpreter = 0; + + /** + * Exec outputFilePath. + * @member {string} outputFilePath + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @instance + */ + Exec.prototype.outputFilePath = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Exec source. + * @member {"file"|"script"|undefined} source + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @instance + */ + Object.defineProperty(Exec.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["file", "script"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Exec instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec} Exec instance + */ + Exec.create = function create(properties) { + return new Exec(properties); + }; + + /** + * Encodes the specified Exec message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec} message Exec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && Object.hasOwnProperty.call(message, "file")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.script != null && Object.hasOwnProperty.call(message, "script")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.script); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); + if (message.interpreter != null && Object.hasOwnProperty.call(message, "interpreter")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.interpreter); + if (message.outputFilePath != null && Object.hasOwnProperty.call(message, "outputFilePath")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.outputFilePath); + return writer; + }; + + /** + * Encodes the specified Exec message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.IExec} message Exec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Exec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec} Exec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.file = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.decode(reader, reader.uint32()); + break; + } + case 2: { + message.script = reader.string(); + break; + } + case 3: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 4: { + message.interpreter = reader.int32(); + break; + } + case 5: { + message.outputFilePath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Exec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec} Exec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Exec message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Exec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.file != null && message.hasOwnProperty("file")) { + properties.source = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.verify(message.file); + if (error) + return "file." + error; + } + } + if (message.script != null && message.hasOwnProperty("script")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.script)) + return "script: string expected"; + } + 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.interpreter != null && message.hasOwnProperty("interpreter")) + switch (message.interpreter) { + default: + return "interpreter: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.outputFilePath != null && message.hasOwnProperty("outputFilePath")) + if (!$util.isString(message.outputFilePath)) + return "outputFilePath: string expected"; + return null; + }; + + /** + * Creates an Exec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec} Exec + */ + Exec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec(); + if (object.file != null) { + if (typeof object.file !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.file: object expected"); + message.file = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.fromObject(object.file); + } + if (object.script != null) + message.script = String(object.script); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + switch (object.interpreter) { + default: + if (typeof object.interpreter === "number") { + message.interpreter = object.interpreter; + break; + } + break; + case "INTERPRETER_UNSPECIFIED": + case 0: + message.interpreter = 0; + break; + case "NONE": + case 1: + message.interpreter = 1; + break; + case "SHELL": + case 2: + message.interpreter = 2; + break; + case "POWERSHELL": + case 3: + message.interpreter = 3; + break; + } + if (object.outputFilePath != null) + message.outputFilePath = String(object.outputFilePath); + return message; + }; + + /** + * Creates a plain object from an Exec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec} message Exec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Exec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.interpreter = options.enums === String ? "INTERPRETER_UNSPECIFIED" : 0; + object.outputFilePath = ""; + } + if (message.file != null && message.hasOwnProperty("file")) { + object.file = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.toObject(message.file, options); + if (options.oneofs) + object.source = "file"; + } + if (message.script != null && message.hasOwnProperty("script")) { + object.script = message.script; + if (options.oneofs) + object.source = "script"; + } + 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.interpreter != null && message.hasOwnProperty("interpreter")) + object.interpreter = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.Interpreter[message.interpreter] === undefined ? message.interpreter : $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.Interpreter[message.interpreter] : message.interpreter; + if (message.outputFilePath != null && message.hasOwnProperty("outputFilePath")) + object.outputFilePath = message.outputFilePath; + return object; + }; + + /** + * Converts this Exec to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @instance + * @returns {Object.} JSON object + */ + Exec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Exec + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Exec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec"; + }; + + /** + * Interpreter enum. + * @name google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec.Interpreter + * @enum {number} + * @property {number} INTERPRETER_UNSPECIFIED=0 INTERPRETER_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} SHELL=2 SHELL value + * @property {number} POWERSHELL=3 POWERSHELL value + */ + Exec.Interpreter = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERPRETER_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "SHELL"] = 2; + values[valuesById[3] = "POWERSHELL"] = 3; + return values; + })(); + + return Exec; + })(); + + return ExecResource; + })(); + + Resource.FileResource = (function() { + + /** + * Properties of a FileResource. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @interface IFileResource + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null} [file] FileResource file + * @property {string|null} [content] FileResource content + * @property {string|null} [path] FileResource path + * @property {google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.DesiredState|null} [state] FileResource state + * @property {string|null} [permissions] FileResource permissions + */ + + /** + * Constructs a new FileResource. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource + * @classdesc Represents a FileResource. + * @implements IFileResource + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFileResource=} [properties] Properties to set + */ + function FileResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileResource file. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFile|null|undefined} file + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @instance + */ + FileResource.prototype.file = null; + + /** + * FileResource content. + * @member {string|null|undefined} content + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @instance + */ + FileResource.prototype.content = null; + + /** + * FileResource path. + * @member {string} path + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @instance + */ + FileResource.prototype.path = ""; + + /** + * FileResource state. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.DesiredState} state + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @instance + */ + FileResource.prototype.state = 0; + + /** + * FileResource permissions. + * @member {string} permissions + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @instance + */ + FileResource.prototype.permissions = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FileResource source. + * @member {"file"|"content"|undefined} source + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @instance + */ + Object.defineProperty(FileResource.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["file", "content"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FileResource instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFileResource=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource} FileResource instance + */ + FileResource.create = function create(properties) { + return new FileResource(properties); + }; + + /** + * Encodes the specified FileResource message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFileResource} message FileResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && Object.hasOwnProperty.call(message, "file")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.path); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.permissions != null && Object.hasOwnProperty.call(message, "permissions")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.permissions); + return writer; + }; + + /** + * Encodes the specified FileResource message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.IFileResource} message FileResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource} FileResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.file = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.decode(reader, reader.uint32()); + break; + } + case 2: { + message.content = reader.string(); + break; + } + case 3: { + message.path = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.permissions = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource} FileResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileResource message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.file != null && message.hasOwnProperty("file")) { + properties.source = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.verify(message.file); + if (error) + return "file." + error; + } + } + if (message.content != null && message.hasOwnProperty("content")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.content)) + return "content: string expected"; + } + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.permissions != null && message.hasOwnProperty("permissions")) + if (!$util.isString(message.permissions)) + return "permissions: string expected"; + return null; + }; + + /** + * Creates a FileResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource} FileResource + */ + FileResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource(); + if (object.file != null) { + if (typeof object.file !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.file: object expected"); + message.file = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.fromObject(object.file); + } + if (object.content != null) + message.content = String(object.content); + if (object.path != null) + message.path = String(object.path); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "DESIRED_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PRESENT": + case 1: + message.state = 1; + break; + case "ABSENT": + case 2: + message.state = 2; + break; + case "CONTENTS_MATCH": + case 3: + message.state = 3; + break; + } + if (object.permissions != null) + message.permissions = String(object.permissions); + return message; + }; + + /** + * Creates a plain object from a FileResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource} message FileResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.path = ""; + object.state = options.enums === String ? "DESIRED_STATE_UNSPECIFIED" : 0; + object.permissions = ""; + } + if (message.file != null && message.hasOwnProperty("file")) { + object.file = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.File.toObject(message.file, options); + if (options.oneofs) + object.source = "file"; + } + if (message.content != null && message.hasOwnProperty("content")) { + object.content = message.content; + if (options.oneofs) + object.source = "content"; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.DesiredState[message.state] === undefined ? message.state : $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.DesiredState[message.state] : message.state; + if (message.permissions != null && message.hasOwnProperty("permissions")) + object.permissions = message.permissions; + return object; + }; + + /** + * Converts this FileResource to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @instance + * @returns {Object.} JSON object + */ + FileResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileResource + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource"; + }; + + /** + * DesiredState enum. + * @name google.cloud.osconfig.v1alpha.OSPolicy.Resource.FileResource.DesiredState + * @enum {number} + * @property {number} DESIRED_STATE_UNSPECIFIED=0 DESIRED_STATE_UNSPECIFIED value + * @property {number} PRESENT=1 PRESENT value + * @property {number} ABSENT=2 ABSENT value + * @property {number} CONTENTS_MATCH=3 CONTENTS_MATCH value + */ + FileResource.DesiredState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DESIRED_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRESENT"] = 1; + values[valuesById[2] = "ABSENT"] = 2; + values[valuesById[3] = "CONTENTS_MATCH"] = 3; + return values; + })(); + + return FileResource; + })(); + + return Resource; + })(); + + OSPolicy.ResourceGroup = (function() { + + /** + * Properties of a ResourceGroup. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @interface IResourceGroup + * @property {google.cloud.osconfig.v1alpha.OSPolicy.IOSFilter|null} [osFilter] ResourceGroup osFilter + * @property {Array.|null} [inventoryFilters] ResourceGroup inventoryFilters + * @property {Array.|null} [resources] ResourceGroup resources + */ + + /** + * Constructs a new ResourceGroup. + * @memberof google.cloud.osconfig.v1alpha.OSPolicy + * @classdesc Represents a ResourceGroup. + * @implements IResourceGroup + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IResourceGroup=} [properties] Properties to set + */ + function ResourceGroup(properties) { + this.inventoryFilters = []; + this.resources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceGroup osFilter. + * @member {google.cloud.osconfig.v1alpha.OSPolicy.IOSFilter|null|undefined} osFilter + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup + * @instance + */ + ResourceGroup.prototype.osFilter = null; + + /** + * ResourceGroup inventoryFilters. + * @member {Array.} inventoryFilters + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup + * @instance + */ + ResourceGroup.prototype.inventoryFilters = $util.emptyArray; + + /** + * ResourceGroup resources. + * @member {Array.} resources + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup + * @instance + */ + ResourceGroup.prototype.resources = $util.emptyArray; + + /** + * Creates a new ResourceGroup instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IResourceGroup=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup} ResourceGroup instance + */ + ResourceGroup.create = function create(properties) { + return new ResourceGroup(properties); + }; + + /** + * Encodes the specified ResourceGroup message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IResourceGroup} message ResourceGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osFilter != null && Object.hasOwnProperty.call(message, "osFilter")) + $root.google.cloud.osconfig.v1alpha.OSPolicy.OSFilter.encode(message.osFilter, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.encode(message.resources[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inventoryFilters != null && message.inventoryFilters.length) + for (var i = 0; i < message.inventoryFilters.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter.encode(message.inventoryFilters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourceGroup message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.IResourceGroup} message ResourceGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup} ResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osFilter = $root.google.cloud.osconfig.v1alpha.OSPolicy.OSFilter.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.inventoryFilters && message.inventoryFilters.length)) + message.inventoryFilters = []; + message.inventoryFilters.push($root.google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup} ResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceGroup message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osFilter != null && message.hasOwnProperty("osFilter")) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.OSFilter.verify(message.osFilter); + if (error) + return "osFilter." + error; + } + if (message.inventoryFilters != null && message.hasOwnProperty("inventoryFilters")) { + if (!Array.isArray(message.inventoryFilters)) + return "inventoryFilters: array expected"; + for (var i = 0; i < message.inventoryFilters.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter.verify(message.inventoryFilters[i]); + if (error) + return "inventoryFilters." + error; + } + } + if (message.resources != null && message.hasOwnProperty("resources")) { + if (!Array.isArray(message.resources)) + return "resources: array expected"; + for (var i = 0; i < message.resources.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.verify(message.resources[i]); + if (error) + return "resources." + error; + } + } + return null; + }; + + /** + * Creates a ResourceGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup} ResourceGroup + */ + ResourceGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup(); + if (object.osFilter != null) { + if (typeof object.osFilter !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.osFilter: object expected"); + message.osFilter = $root.google.cloud.osconfig.v1alpha.OSPolicy.OSFilter.fromObject(object.osFilter); + } + if (object.inventoryFilters) { + if (!Array.isArray(object.inventoryFilters)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.inventoryFilters: array expected"); + message.inventoryFilters = []; + for (var i = 0; i < object.inventoryFilters.length; ++i) { + if (typeof object.inventoryFilters[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.inventoryFilters: object expected"); + message.inventoryFilters[i] = $root.google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter.fromObject(object.inventoryFilters[i]); + } + } + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup.resources: object expected"); + message.resources[i] = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.fromObject(object.resources[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup} message ResourceGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.inventoryFilters = []; + } + if (options.defaults) + object.osFilter = null; + if (message.osFilter != null && message.hasOwnProperty("osFilter")) + object.osFilter = $root.google.cloud.osconfig.v1alpha.OSPolicy.OSFilter.toObject(message.osFilter, options); + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.osconfig.v1alpha.OSPolicy.Resource.toObject(message.resources[j], options); + } + if (message.inventoryFilters && message.inventoryFilters.length) { + object.inventoryFilters = []; + for (var j = 0; j < message.inventoryFilters.length; ++j) + object.inventoryFilters[j] = $root.google.cloud.osconfig.v1alpha.OSPolicy.InventoryFilter.toObject(message.inventoryFilters[j], options); + } + return object; + }; + + /** + * Converts this ResourceGroup to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup + * @instance + * @returns {Object.} JSON object + */ + ResourceGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceGroup + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup"; + }; + + return ResourceGroup; + })(); + + return OSPolicy; + })(); + + v1alpha.GetOSPolicyAssignmentReportRequest = (function() { + + /** + * Properties of a GetOSPolicyAssignmentReportRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface IGetOSPolicyAssignmentReportRequest + * @property {string|null} [name] GetOSPolicyAssignmentReportRequest name + */ + + /** + * Constructs a new GetOSPolicyAssignmentReportRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a GetOSPolicyAssignmentReportRequest. + * @implements IGetOSPolicyAssignmentReportRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest=} [properties] Properties to set + */ + function GetOSPolicyAssignmentReportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOSPolicyAssignmentReportRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest + * @instance + */ + GetOSPolicyAssignmentReportRequest.prototype.name = ""; + + /** + * Creates a new GetOSPolicyAssignmentReportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest} GetOSPolicyAssignmentReportRequest instance + */ + GetOSPolicyAssignmentReportRequest.create = function create(properties) { + return new GetOSPolicyAssignmentReportRequest(properties); + }; + + /** + * Encodes the specified GetOSPolicyAssignmentReportRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest} message GetOSPolicyAssignmentReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOSPolicyAssignmentReportRequest.encode = function encode(message, writer) { + 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 GetOSPolicyAssignmentReportRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest} message GetOSPolicyAssignmentReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOSPolicyAssignmentReportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOSPolicyAssignmentReportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest} GetOSPolicyAssignmentReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOSPolicyAssignmentReportRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest(); + 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 GetOSPolicyAssignmentReportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest} GetOSPolicyAssignmentReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOSPolicyAssignmentReportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOSPolicyAssignmentReportRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOSPolicyAssignmentReportRequest.verify = function verify(message) { + if (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 GetOSPolicyAssignmentReportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest} GetOSPolicyAssignmentReportRequest + */ + GetOSPolicyAssignmentReportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOSPolicyAssignmentReportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest + * @static + * @param {google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest} message GetOSPolicyAssignmentReportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOSPolicyAssignmentReportRequest.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 GetOSPolicyAssignmentReportRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest + * @instance + * @returns {Object.} JSON object + */ + GetOSPolicyAssignmentReportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOSPolicyAssignmentReportRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOSPolicyAssignmentReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest"; + }; + + return GetOSPolicyAssignmentReportRequest; + })(); + + v1alpha.ListOSPolicyAssignmentReportsRequest = (function() { + + /** + * Properties of a ListOSPolicyAssignmentReportsRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface IListOSPolicyAssignmentReportsRequest + * @property {string|null} [parent] ListOSPolicyAssignmentReportsRequest parent + * @property {number|null} [pageSize] ListOSPolicyAssignmentReportsRequest pageSize + * @property {string|null} [filter] ListOSPolicyAssignmentReportsRequest filter + * @property {string|null} [pageToken] ListOSPolicyAssignmentReportsRequest pageToken + */ + + /** + * Constructs a new ListOSPolicyAssignmentReportsRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a ListOSPolicyAssignmentReportsRequest. + * @implements IListOSPolicyAssignmentReportsRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest=} [properties] Properties to set + */ + function ListOSPolicyAssignmentReportsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOSPolicyAssignmentReportsRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @instance + */ + ListOSPolicyAssignmentReportsRequest.prototype.parent = ""; + + /** + * ListOSPolicyAssignmentReportsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @instance + */ + ListOSPolicyAssignmentReportsRequest.prototype.pageSize = 0; + + /** + * ListOSPolicyAssignmentReportsRequest filter. + * @member {string} filter + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @instance + */ + ListOSPolicyAssignmentReportsRequest.prototype.filter = ""; + + /** + * ListOSPolicyAssignmentReportsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @instance + */ + ListOSPolicyAssignmentReportsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOSPolicyAssignmentReportsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest} ListOSPolicyAssignmentReportsRequest instance + */ + ListOSPolicyAssignmentReportsRequest.create = function create(properties) { + return new ListOSPolicyAssignmentReportsRequest(properties); + }; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest} message ListOSPolicyAssignmentReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentReportsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest} message ListOSPolicyAssignmentReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentReportsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOSPolicyAssignmentReportsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest} ListOSPolicyAssignmentReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentReportsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest(); + 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.filter = reader.string(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOSPolicyAssignmentReportsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest} ListOSPolicyAssignmentReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentReportsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOSPolicyAssignmentReportsRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOSPolicyAssignmentReportsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOSPolicyAssignmentReportsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest} ListOSPolicyAssignmentReportsRequest + */ + ListOSPolicyAssignmentReportsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOSPolicyAssignmentReportsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest} message ListOSPolicyAssignmentReportsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOSPolicyAssignmentReportsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.filter = ""; + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListOSPolicyAssignmentReportsRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOSPolicyAssignmentReportsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOSPolicyAssignmentReportsRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOSPolicyAssignmentReportsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest"; + }; + + return ListOSPolicyAssignmentReportsRequest; + })(); + + v1alpha.ListOSPolicyAssignmentReportsResponse = (function() { + + /** + * Properties of a ListOSPolicyAssignmentReportsResponse. + * @memberof google.cloud.osconfig.v1alpha + * @interface IListOSPolicyAssignmentReportsResponse + * @property {Array.|null} [osPolicyAssignmentReports] ListOSPolicyAssignmentReportsResponse osPolicyAssignmentReports + * @property {string|null} [nextPageToken] ListOSPolicyAssignmentReportsResponse nextPageToken + */ + + /** + * Constructs a new ListOSPolicyAssignmentReportsResponse. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a ListOSPolicyAssignmentReportsResponse. + * @implements IListOSPolicyAssignmentReportsResponse + * @constructor + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse=} [properties] Properties to set + */ + function ListOSPolicyAssignmentReportsResponse(properties) { + this.osPolicyAssignmentReports = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOSPolicyAssignmentReportsResponse osPolicyAssignmentReports. + * @member {Array.} osPolicyAssignmentReports + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse + * @instance + */ + ListOSPolicyAssignmentReportsResponse.prototype.osPolicyAssignmentReports = $util.emptyArray; + + /** + * ListOSPolicyAssignmentReportsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse + * @instance + */ + ListOSPolicyAssignmentReportsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOSPolicyAssignmentReportsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse} ListOSPolicyAssignmentReportsResponse instance + */ + ListOSPolicyAssignmentReportsResponse.create = function create(properties) { + return new ListOSPolicyAssignmentReportsResponse(properties); + }; + + /** + * Encodes the specified ListOSPolicyAssignmentReportsResponse message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse} message ListOSPolicyAssignmentReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentReportsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyAssignmentReports != null && message.osPolicyAssignmentReports.length) + for (var i = 0; i < message.osPolicyAssignmentReports.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.encode(message.osPolicyAssignmentReports[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 ListOSPolicyAssignmentReportsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse} message ListOSPolicyAssignmentReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentReportsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOSPolicyAssignmentReportsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse} ListOSPolicyAssignmentReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentReportsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.osPolicyAssignmentReports && message.osPolicyAssignmentReports.length)) + message.osPolicyAssignmentReports = []; + message.osPolicyAssignmentReports.push($root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOSPolicyAssignmentReportsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse} ListOSPolicyAssignmentReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentReportsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOSPolicyAssignmentReportsResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOSPolicyAssignmentReportsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osPolicyAssignmentReports != null && message.hasOwnProperty("osPolicyAssignmentReports")) { + if (!Array.isArray(message.osPolicyAssignmentReports)) + return "osPolicyAssignmentReports: array expected"; + for (var i = 0; i < message.osPolicyAssignmentReports.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.verify(message.osPolicyAssignmentReports[i]); + if (error) + return "osPolicyAssignmentReports." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOSPolicyAssignmentReportsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse} ListOSPolicyAssignmentReportsResponse + */ + ListOSPolicyAssignmentReportsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse(); + if (object.osPolicyAssignmentReports) { + if (!Array.isArray(object.osPolicyAssignmentReports)) + throw TypeError(".google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse.osPolicyAssignmentReports: array expected"); + message.osPolicyAssignmentReports = []; + for (var i = 0; i < object.osPolicyAssignmentReports.length; ++i) { + if (typeof object.osPolicyAssignmentReports[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse.osPolicyAssignmentReports: object expected"); + message.osPolicyAssignmentReports[i] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.fromObject(object.osPolicyAssignmentReports[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOSPolicyAssignmentReportsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse} message ListOSPolicyAssignmentReportsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOSPolicyAssignmentReportsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicyAssignmentReports = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.osPolicyAssignmentReports && message.osPolicyAssignmentReports.length) { + object.osPolicyAssignmentReports = []; + for (var j = 0; j < message.osPolicyAssignmentReports.length; ++j) + object.osPolicyAssignmentReports[j] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.toObject(message.osPolicyAssignmentReports[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOSPolicyAssignmentReportsResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOSPolicyAssignmentReportsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOSPolicyAssignmentReportsResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOSPolicyAssignmentReportsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse"; + }; + + return ListOSPolicyAssignmentReportsResponse; + })(); + + v1alpha.OSPolicyAssignmentReport = (function() { + + /** + * Properties of a OSPolicyAssignmentReport. + * @memberof google.cloud.osconfig.v1alpha + * @interface IOSPolicyAssignmentReport + * @property {string|null} [name] OSPolicyAssignmentReport name + * @property {string|null} [instance] OSPolicyAssignmentReport instance + * @property {string|null} [osPolicyAssignment] OSPolicyAssignmentReport osPolicyAssignment + * @property {Array.|null} [osPolicyCompliances] OSPolicyAssignmentReport osPolicyCompliances + * @property {google.protobuf.ITimestamp|null} [updateTime] OSPolicyAssignmentReport updateTime + * @property {string|null} [lastRunId] OSPolicyAssignmentReport lastRunId + */ + + /** + * Constructs a new OSPolicyAssignmentReport. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a OSPolicyAssignmentReport. + * @implements IOSPolicyAssignmentReport + * @constructor + * @param {google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport=} [properties] Properties to set + */ + function OSPolicyAssignmentReport(properties) { + this.osPolicyCompliances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyAssignmentReport name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @instance + */ + OSPolicyAssignmentReport.prototype.name = ""; + + /** + * OSPolicyAssignmentReport instance. + * @member {string} instance + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @instance + */ + OSPolicyAssignmentReport.prototype.instance = ""; + + /** + * OSPolicyAssignmentReport osPolicyAssignment. + * @member {string} osPolicyAssignment + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @instance + */ + OSPolicyAssignmentReport.prototype.osPolicyAssignment = ""; + + /** + * OSPolicyAssignmentReport osPolicyCompliances. + * @member {Array.} osPolicyCompliances + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @instance + */ + OSPolicyAssignmentReport.prototype.osPolicyCompliances = $util.emptyArray; + + /** + * OSPolicyAssignmentReport updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @instance + */ + OSPolicyAssignmentReport.prototype.updateTime = null; + + /** + * OSPolicyAssignmentReport lastRunId. + * @member {string} lastRunId + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @instance + */ + OSPolicyAssignmentReport.prototype.lastRunId = ""; + + /** + * Creates a new OSPolicyAssignmentReport instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport} OSPolicyAssignmentReport instance + */ + OSPolicyAssignmentReport.create = function create(properties) { + return new OSPolicyAssignmentReport(properties); + }; + + /** + * Encodes the specified OSPolicyAssignmentReport message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport} message OSPolicyAssignmentReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyAssignmentReport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instance); + if (message.osPolicyAssignment != null && Object.hasOwnProperty.call(message, "osPolicyAssignment")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.osPolicyAssignment); + if (message.osPolicyCompliances != null && message.osPolicyCompliances.length) + for (var i = 0; i < message.osPolicyCompliances.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.encode(message.osPolicyCompliances[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastRunId != null && Object.hasOwnProperty.call(message, "lastRunId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.lastRunId); + return writer; + }; + + /** + * Encodes the specified OSPolicyAssignmentReport message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport} message OSPolicyAssignmentReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyAssignmentReport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyAssignmentReport message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport} OSPolicyAssignmentReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyAssignmentReport.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.instance = reader.string(); + break; + } + case 3: { + message.osPolicyAssignment = reader.string(); + break; + } + case 4: { + if (!(message.osPolicyCompliances && message.osPolicyCompliances.length)) + message.osPolicyCompliances = []; + message.osPolicyCompliances.push($root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.decode(reader, reader.uint32())); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.lastRunId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyAssignmentReport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport} OSPolicyAssignmentReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyAssignmentReport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyAssignmentReport message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyAssignmentReport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + if (!$util.isString(message.osPolicyAssignment)) + return "osPolicyAssignment: string expected"; + if (message.osPolicyCompliances != null && message.hasOwnProperty("osPolicyCompliances")) { + if (!Array.isArray(message.osPolicyCompliances)) + return "osPolicyCompliances: array expected"; + for (var i = 0; i < message.osPolicyCompliances.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.verify(message.osPolicyCompliances[i]); + if (error) + return "osPolicyCompliances." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.lastRunId != null && message.hasOwnProperty("lastRunId")) + if (!$util.isString(message.lastRunId)) + return "lastRunId: string expected"; + return null; + }; + + /** + * Creates a OSPolicyAssignmentReport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport} OSPolicyAssignmentReport + */ + OSPolicyAssignmentReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport(); + if (object.name != null) + message.name = String(object.name); + if (object.instance != null) + message.instance = String(object.instance); + if (object.osPolicyAssignment != null) + message.osPolicyAssignment = String(object.osPolicyAssignment); + if (object.osPolicyCompliances) { + if (!Array.isArray(object.osPolicyCompliances)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.osPolicyCompliances: array expected"); + message.osPolicyCompliances = []; + for (var i = 0; i < object.osPolicyCompliances.length; ++i) { + if (typeof object.osPolicyCompliances[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.osPolicyCompliances: object expected"); + message.osPolicyCompliances[i] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.fromObject(object.osPolicyCompliances[i]); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lastRunId != null) + message.lastRunId = String(object.lastRunId); + return message; + }; + + /** + * Creates a plain object from a OSPolicyAssignmentReport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport} message OSPolicyAssignmentReport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyAssignmentReport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicyCompliances = []; + if (options.defaults) { + object.name = ""; + object.instance = ""; + object.osPolicyAssignment = ""; + object.updateTime = null; + object.lastRunId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + object.osPolicyAssignment = message.osPolicyAssignment; + if (message.osPolicyCompliances && message.osPolicyCompliances.length) { + object.osPolicyCompliances = []; + for (var j = 0; j < message.osPolicyCompliances.length; ++j) + object.osPolicyCompliances[j] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.toObject(message.osPolicyCompliances[j], options); + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.lastRunId != null && message.hasOwnProperty("lastRunId")) + object.lastRunId = message.lastRunId; + return object; + }; + + /** + * Converts this OSPolicyAssignmentReport to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @instance + * @returns {Object.} JSON object + */ + OSPolicyAssignmentReport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyAssignmentReport + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyAssignmentReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport"; + }; + + OSPolicyAssignmentReport.OSPolicyCompliance = (function() { + + /** + * Properties of a OSPolicyCompliance. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @interface IOSPolicyCompliance + * @property {string|null} [osPolicyId] OSPolicyCompliance osPolicyId + * @property {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState|null} [complianceState] OSPolicyCompliance complianceState + * @property {string|null} [complianceStateReason] OSPolicyCompliance complianceStateReason + * @property {Array.|null} [osPolicyResourceCompliances] OSPolicyCompliance osPolicyResourceCompliances + */ + + /** + * Constructs a new OSPolicyCompliance. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + * @classdesc Represents a OSPolicyCompliance. + * @implements IOSPolicyCompliance + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.IOSPolicyCompliance=} [properties] Properties to set + */ + function OSPolicyCompliance(properties) { + this.osPolicyResourceCompliances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyCompliance osPolicyId. + * @member {string} osPolicyId + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @instance + */ + OSPolicyCompliance.prototype.osPolicyId = ""; + + /** + * OSPolicyCompliance complianceState. + * @member {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState} complianceState + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @instance + */ + OSPolicyCompliance.prototype.complianceState = 0; + + /** + * OSPolicyCompliance complianceStateReason. + * @member {string} complianceStateReason + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @instance + */ + OSPolicyCompliance.prototype.complianceStateReason = ""; + + /** + * OSPolicyCompliance osPolicyResourceCompliances. + * @member {Array.} osPolicyResourceCompliances + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @instance + */ + OSPolicyCompliance.prototype.osPolicyResourceCompliances = $util.emptyArray; + + /** + * Creates a new OSPolicyCompliance instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.IOSPolicyCompliance=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance} OSPolicyCompliance instance + */ + OSPolicyCompliance.create = function create(properties) { + return new OSPolicyCompliance(properties); + }; + + /** + * Encodes the specified OSPolicyCompliance message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.IOSPolicyCompliance} message OSPolicyCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyCompliance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyId != null && Object.hasOwnProperty.call(message, "osPolicyId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.osPolicyId); + if (message.complianceState != null && Object.hasOwnProperty.call(message, "complianceState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.complianceState); + if (message.complianceStateReason != null && Object.hasOwnProperty.call(message, "complianceStateReason")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.complianceStateReason); + if (message.osPolicyResourceCompliances != null && message.osPolicyResourceCompliances.length) + for (var i = 0; i < message.osPolicyResourceCompliances.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.encode(message.osPolicyResourceCompliances[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OSPolicyCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.IOSPolicyCompliance} message OSPolicyCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyCompliance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyCompliance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance} OSPolicyCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyCompliance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osPolicyId = reader.string(); + break; + } + case 2: { + message.complianceState = reader.int32(); + break; + } + case 3: { + message.complianceStateReason = reader.string(); + break; + } + case 4: { + if (!(message.osPolicyResourceCompliances && message.osPolicyResourceCompliances.length)) + message.osPolicyResourceCompliances = []; + message.osPolicyResourceCompliances.push($root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyCompliance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance} OSPolicyCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyCompliance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyCompliance message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyCompliance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osPolicyId != null && message.hasOwnProperty("osPolicyId")) + if (!$util.isString(message.osPolicyId)) + return "osPolicyId: string expected"; + if (message.complianceState != null && message.hasOwnProperty("complianceState")) + switch (message.complianceState) { + default: + return "complianceState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.complianceStateReason != null && message.hasOwnProperty("complianceStateReason")) + if (!$util.isString(message.complianceStateReason)) + return "complianceStateReason: string expected"; + if (message.osPolicyResourceCompliances != null && message.hasOwnProperty("osPolicyResourceCompliances")) { + if (!Array.isArray(message.osPolicyResourceCompliances)) + return "osPolicyResourceCompliances: array expected"; + for (var i = 0; i < message.osPolicyResourceCompliances.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.verify(message.osPolicyResourceCompliances[i]); + if (error) + return "osPolicyResourceCompliances." + error; + } + } + return null; + }; + + /** + * Creates a OSPolicyCompliance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance} OSPolicyCompliance + */ + OSPolicyCompliance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance(); + if (object.osPolicyId != null) + message.osPolicyId = String(object.osPolicyId); + switch (object.complianceState) { + default: + if (typeof object.complianceState === "number") { + message.complianceState = object.complianceState; + break; + } + break; + case "UNKNOWN": + case 0: + message.complianceState = 0; + break; + case "COMPLIANT": + case 1: + message.complianceState = 1; + break; + case "NON_COMPLIANT": + case 2: + message.complianceState = 2; + break; + } + if (object.complianceStateReason != null) + message.complianceStateReason = String(object.complianceStateReason); + if (object.osPolicyResourceCompliances) { + if (!Array.isArray(object.osPolicyResourceCompliances)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.osPolicyResourceCompliances: array expected"); + message.osPolicyResourceCompliances = []; + for (var i = 0; i < object.osPolicyResourceCompliances.length; ++i) { + if (typeof object.osPolicyResourceCompliances[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.osPolicyResourceCompliances: object expected"); + message.osPolicyResourceCompliances[i] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.fromObject(object.osPolicyResourceCompliances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a OSPolicyCompliance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance} message OSPolicyCompliance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyCompliance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicyResourceCompliances = []; + if (options.defaults) { + object.osPolicyId = ""; + object.complianceState = options.enums === String ? "UNKNOWN" : 0; + object.complianceStateReason = ""; + } + if (message.osPolicyId != null && message.hasOwnProperty("osPolicyId")) + object.osPolicyId = message.osPolicyId; + if (message.complianceState != null && message.hasOwnProperty("complianceState")) + object.complianceState = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState[message.complianceState] === undefined ? message.complianceState : $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState[message.complianceState] : message.complianceState; + if (message.complianceStateReason != null && message.hasOwnProperty("complianceStateReason")) + object.complianceStateReason = message.complianceStateReason; + if (message.osPolicyResourceCompliances && message.osPolicyResourceCompliances.length) { + object.osPolicyResourceCompliances = []; + for (var j = 0; j < message.osPolicyResourceCompliances.length; ++j) + object.osPolicyResourceCompliances[j] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.toObject(message.osPolicyResourceCompliances[j], options); + } + return object; + }; + + /** + * Converts this OSPolicyCompliance to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @instance + * @returns {Object.} JSON object + */ + OSPolicyCompliance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyCompliance + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyCompliance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance"; + }; + + /** + * ComplianceState enum. + * @name google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} COMPLIANT=1 COMPLIANT value + * @property {number} NON_COMPLIANT=2 NON_COMPLIANT value + */ + OSPolicyCompliance.ComplianceState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "COMPLIANT"] = 1; + values[valuesById[2] = "NON_COMPLIANT"] = 2; + return values; + })(); + + OSPolicyCompliance.OSPolicyResourceCompliance = (function() { + + /** + * Properties of a OSPolicyResourceCompliance. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @interface IOSPolicyResourceCompliance + * @property {string|null} [osPolicyResourceId] OSPolicyResourceCompliance osPolicyResourceId + * @property {Array.|null} [configSteps] OSPolicyResourceCompliance configSteps + * @property {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState|null} [complianceState] OSPolicyResourceCompliance complianceState + * @property {string|null} [complianceStateReason] OSPolicyResourceCompliance complianceStateReason + * @property {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput|null} [execResourceOutput] OSPolicyResourceCompliance execResourceOutput + */ + + /** + * Constructs a new OSPolicyResourceCompliance. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance + * @classdesc Represents a OSPolicyResourceCompliance. + * @implements IOSPolicyResourceCompliance + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance=} [properties] Properties to set + */ + function OSPolicyResourceCompliance(properties) { + this.configSteps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyResourceCompliance osPolicyResourceId. + * @member {string} osPolicyResourceId + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.osPolicyResourceId = ""; + + /** + * OSPolicyResourceCompliance configSteps. + * @member {Array.} configSteps + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.configSteps = $util.emptyArray; + + /** + * OSPolicyResourceCompliance complianceState. + * @member {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState} complianceState + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.complianceState = 0; + + /** + * OSPolicyResourceCompliance complianceStateReason. + * @member {string} complianceStateReason + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.complianceStateReason = ""; + + /** + * OSPolicyResourceCompliance execResourceOutput. + * @member {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput|null|undefined} execResourceOutput + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + */ + OSPolicyResourceCompliance.prototype.execResourceOutput = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OSPolicyResourceCompliance output. + * @member {"execResourceOutput"|undefined} output + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + */ + Object.defineProperty(OSPolicyResourceCompliance.prototype, "output", { + get: $util.oneOfGetter($oneOfFields = ["execResourceOutput"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OSPolicyResourceCompliance instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance} OSPolicyResourceCompliance instance + */ + OSPolicyResourceCompliance.create = function create(properties) { + return new OSPolicyResourceCompliance(properties); + }; + + /** + * Encodes the specified OSPolicyResourceCompliance message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance} message OSPolicyResourceCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyResourceCompliance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyResourceId != null && Object.hasOwnProperty.call(message, "osPolicyResourceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.osPolicyResourceId); + if (message.configSteps != null && message.configSteps.length) + for (var i = 0; i < message.configSteps.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.encode(message.configSteps[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.complianceState != null && Object.hasOwnProperty.call(message, "complianceState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.complianceState); + if (message.complianceStateReason != null && Object.hasOwnProperty.call(message, "complianceStateReason")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.complianceStateReason); + if (message.execResourceOutput != null && Object.hasOwnProperty.call(message, "execResourceOutput")) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.encode(message.execResourceOutput, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OSPolicyResourceCompliance message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.IOSPolicyResourceCompliance} message OSPolicyResourceCompliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyResourceCompliance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyResourceCompliance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance} OSPolicyResourceCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyResourceCompliance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osPolicyResourceId = reader.string(); + break; + } + case 2: { + if (!(message.configSteps && message.configSteps.length)) + message.configSteps = []; + message.configSteps.push($root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.decode(reader, reader.uint32())); + break; + } + case 3: { + message.complianceState = reader.int32(); + break; + } + case 4: { + message.complianceStateReason = reader.string(); + break; + } + case 5: { + message.execResourceOutput = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyResourceCompliance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance} OSPolicyResourceCompliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyResourceCompliance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyResourceCompliance message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyResourceCompliance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.osPolicyResourceId != null && message.hasOwnProperty("osPolicyResourceId")) + if (!$util.isString(message.osPolicyResourceId)) + return "osPolicyResourceId: string expected"; + if (message.configSteps != null && message.hasOwnProperty("configSteps")) { + if (!Array.isArray(message.configSteps)) + return "configSteps: array expected"; + for (var i = 0; i < message.configSteps.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.verify(message.configSteps[i]); + if (error) + return "configSteps." + error; + } + } + if (message.complianceState != null && message.hasOwnProperty("complianceState")) + switch (message.complianceState) { + default: + return "complianceState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.complianceStateReason != null && message.hasOwnProperty("complianceStateReason")) + if (!$util.isString(message.complianceStateReason)) + return "complianceStateReason: string expected"; + if (message.execResourceOutput != null && message.hasOwnProperty("execResourceOutput")) { + properties.output = 1; + { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.verify(message.execResourceOutput); + if (error) + return "execResourceOutput." + error; + } + } + return null; + }; + + /** + * Creates a OSPolicyResourceCompliance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance} OSPolicyResourceCompliance + */ + OSPolicyResourceCompliance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance(); + if (object.osPolicyResourceId != null) + message.osPolicyResourceId = String(object.osPolicyResourceId); + if (object.configSteps) { + if (!Array.isArray(object.configSteps)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.configSteps: array expected"); + message.configSteps = []; + for (var i = 0; i < object.configSteps.length; ++i) { + if (typeof object.configSteps[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.configSteps: object expected"); + message.configSteps[i] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.fromObject(object.configSteps[i]); + } + } + switch (object.complianceState) { + default: + if (typeof object.complianceState === "number") { + message.complianceState = object.complianceState; + break; + } + break; + case "UNKNOWN": + case 0: + message.complianceState = 0; + break; + case "COMPLIANT": + case 1: + message.complianceState = 1; + break; + case "NON_COMPLIANT": + case 2: + message.complianceState = 2; + break; + } + if (object.complianceStateReason != null) + message.complianceStateReason = String(object.complianceStateReason); + if (object.execResourceOutput != null) { + if (typeof object.execResourceOutput !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.execResourceOutput: object expected"); + message.execResourceOutput = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.fromObject(object.execResourceOutput); + } + return message; + }; + + /** + * Creates a plain object from a OSPolicyResourceCompliance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance} message OSPolicyResourceCompliance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyResourceCompliance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.configSteps = []; + if (options.defaults) { + object.osPolicyResourceId = ""; + object.complianceState = options.enums === String ? "UNKNOWN" : 0; + object.complianceStateReason = ""; + } + if (message.osPolicyResourceId != null && message.hasOwnProperty("osPolicyResourceId")) + object.osPolicyResourceId = message.osPolicyResourceId; + if (message.configSteps && message.configSteps.length) { + object.configSteps = []; + for (var j = 0; j < message.configSteps.length; ++j) + object.configSteps[j] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.toObject(message.configSteps[j], options); + } + if (message.complianceState != null && message.hasOwnProperty("complianceState")) + object.complianceState = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState[message.complianceState] === undefined ? message.complianceState : $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState[message.complianceState] : message.complianceState; + if (message.complianceStateReason != null && message.hasOwnProperty("complianceStateReason")) + object.complianceStateReason = message.complianceStateReason; + if (message.execResourceOutput != null && message.hasOwnProperty("execResourceOutput")) { + object.execResourceOutput = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.toObject(message.execResourceOutput, options); + if (options.oneofs) + object.output = "execResourceOutput"; + } + return object; + }; + + /** + * Converts this OSPolicyResourceCompliance to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @instance + * @returns {Object.} JSON object + */ + OSPolicyResourceCompliance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyResourceCompliance + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyResourceCompliance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance"; + }; + + OSPolicyResourceCompliance.OSPolicyResourceConfigStep = (function() { + + /** + * Properties of a OSPolicyResourceConfigStep. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @interface IOSPolicyResourceConfigStep + * @property {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type|null} [type] OSPolicyResourceConfigStep type + * @property {string|null} [errorMessage] OSPolicyResourceConfigStep errorMessage + */ + + /** + * Constructs a new OSPolicyResourceConfigStep. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @classdesc Represents a OSPolicyResourceConfigStep. + * @implements IOSPolicyResourceConfigStep + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep=} [properties] Properties to set + */ + function OSPolicyResourceConfigStep(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyResourceConfigStep type. + * @member {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type} type + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @instance + */ + OSPolicyResourceConfigStep.prototype.type = 0; + + /** + * OSPolicyResourceConfigStep errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @instance + */ + OSPolicyResourceConfigStep.prototype.errorMessage = ""; + + /** + * Creates a new OSPolicyResourceConfigStep instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep} OSPolicyResourceConfigStep instance + */ + OSPolicyResourceConfigStep.create = function create(properties) { + return new OSPolicyResourceConfigStep(properties); + }; + + /** + * Encodes the specified OSPolicyResourceConfigStep message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep} message OSPolicyResourceConfigStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyResourceConfigStep.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage); + return writer; + }; + + /** + * Encodes the specified OSPolicyResourceConfigStep message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IOSPolicyResourceConfigStep} message OSPolicyResourceConfigStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyResourceConfigStep.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyResourceConfigStep message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep} OSPolicyResourceConfigStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyResourceConfigStep.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.errorMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyResourceConfigStep message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep} OSPolicyResourceConfigStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyResourceConfigStep.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyResourceConfigStep message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyResourceConfigStep.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + return null; + }; + + /** + * Creates a OSPolicyResourceConfigStep message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep} OSPolicyResourceConfigStep + */ + OSPolicyResourceConfigStep.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "VALIDATION": + case 1: + message.type = 1; + break; + case "DESIRED_STATE_CHECK": + case 2: + message.type = 2; + break; + case "DESIRED_STATE_ENFORCEMENT": + case 3: + message.type = 3; + break; + case "DESIRED_STATE_CHECK_POST_ENFORCEMENT": + case 4: + message.type = 4; + break; + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + return message; + }; + + /** + * Creates a plain object from a OSPolicyResourceConfigStep message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep} message OSPolicyResourceConfigStep + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyResourceConfigStep.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.errorMessage = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type[message.type] === undefined ? message.type : $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type[message.type] : message.type; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + return object; + }; + + /** + * Converts this OSPolicyResourceConfigStep to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @instance + * @returns {Object.} JSON object + */ + OSPolicyResourceConfigStep.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyResourceConfigStep + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyResourceConfigStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep"; + }; + + /** + * Type enum. + * @name google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} VALIDATION=1 VALIDATION value + * @property {number} DESIRED_STATE_CHECK=2 DESIRED_STATE_CHECK value + * @property {number} DESIRED_STATE_ENFORCEMENT=3 DESIRED_STATE_ENFORCEMENT value + * @property {number} DESIRED_STATE_CHECK_POST_ENFORCEMENT=4 DESIRED_STATE_CHECK_POST_ENFORCEMENT value + */ + OSPolicyResourceConfigStep.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VALIDATION"] = 1; + values[valuesById[2] = "DESIRED_STATE_CHECK"] = 2; + values[valuesById[3] = "DESIRED_STATE_ENFORCEMENT"] = 3; + values[valuesById[4] = "DESIRED_STATE_CHECK_POST_ENFORCEMENT"] = 4; + return values; + })(); + + return OSPolicyResourceConfigStep; + })(); + + /** + * ComplianceState enum. + * @name google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} COMPLIANT=1 COMPLIANT value + * @property {number} NON_COMPLIANT=2 NON_COMPLIANT value + */ + OSPolicyResourceCompliance.ComplianceState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "COMPLIANT"] = 1; + values[valuesById[2] = "NON_COMPLIANT"] = 2; + return values; + })(); + + OSPolicyResourceCompliance.ExecResourceOutput = (function() { + + /** + * Properties of an ExecResourceOutput. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @interface IExecResourceOutput + * @property {Uint8Array|null} [enforcementOutput] ExecResourceOutput enforcementOutput + */ + + /** + * Constructs a new ExecResourceOutput. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance + * @classdesc Represents an ExecResourceOutput. + * @implements IExecResourceOutput + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput=} [properties] Properties to set + */ + function ExecResourceOutput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecResourceOutput enforcementOutput. + * @member {Uint8Array} enforcementOutput + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @instance + */ + ExecResourceOutput.prototype.enforcementOutput = $util.newBuffer([]); + + /** + * Creates a new ExecResourceOutput instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput} ExecResourceOutput instance + */ + ExecResourceOutput.create = function create(properties) { + return new ExecResourceOutput(properties); + }; + + /** + * Encodes the specified ExecResourceOutput message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput} message ExecResourceOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecResourceOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enforcementOutput != null && Object.hasOwnProperty.call(message, "enforcementOutput")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.enforcementOutput); + return writer; + }; + + /** + * Encodes the specified ExecResourceOutput message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.IExecResourceOutput} message ExecResourceOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecResourceOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecResourceOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput} ExecResourceOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecResourceOutput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.enforcementOutput = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecResourceOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput} ExecResourceOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecResourceOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecResourceOutput message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecResourceOutput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enforcementOutput != null && message.hasOwnProperty("enforcementOutput")) + if (!(message.enforcementOutput && typeof message.enforcementOutput.length === "number" || $util.isString(message.enforcementOutput))) + return "enforcementOutput: buffer expected"; + return null; + }; + + /** + * Creates an ExecResourceOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput} ExecResourceOutput + */ + ExecResourceOutput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput(); + if (object.enforcementOutput != null) + if (typeof object.enforcementOutput === "string") + $util.base64.decode(object.enforcementOutput, message.enforcementOutput = $util.newBuffer($util.base64.length(object.enforcementOutput)), 0); + else if (object.enforcementOutput.length >= 0) + message.enforcementOutput = object.enforcementOutput; + return message; + }; + + /** + * Creates a plain object from an ExecResourceOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput} message ExecResourceOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecResourceOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.enforcementOutput = ""; + else { + object.enforcementOutput = []; + if (options.bytes !== Array) + object.enforcementOutput = $util.newBuffer(object.enforcementOutput); + } + if (message.enforcementOutput != null && message.hasOwnProperty("enforcementOutput")) + object.enforcementOutput = options.bytes === String ? $util.base64.encode(message.enforcementOutput, 0, message.enforcementOutput.length) : options.bytes === Array ? Array.prototype.slice.call(message.enforcementOutput) : message.enforcementOutput; + return object; + }; + + /** + * Converts this ExecResourceOutput to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @instance + * @returns {Object.} JSON object + */ + ExecResourceOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecResourceOutput + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecResourceOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput"; + }; + + return ExecResourceOutput; + })(); + + return OSPolicyResourceCompliance; + })(); + + return OSPolicyCompliance; + })(); + + return OSPolicyAssignmentReport; + })(); + + v1alpha.OSPolicyAssignment = (function() { + + /** + * Properties of a OSPolicyAssignment. + * @memberof google.cloud.osconfig.v1alpha + * @interface IOSPolicyAssignment + * @property {string|null} [name] OSPolicyAssignment name + * @property {string|null} [description] OSPolicyAssignment description + * @property {Array.|null} [osPolicies] OSPolicyAssignment osPolicies + * @property {google.cloud.osconfig.v1alpha.OSPolicyAssignment.IInstanceFilter|null} [instanceFilter] OSPolicyAssignment instanceFilter + * @property {google.cloud.osconfig.v1alpha.OSPolicyAssignment.IRollout|null} [rollout] OSPolicyAssignment rollout + * @property {string|null} [revisionId] OSPolicyAssignment revisionId + * @property {google.protobuf.ITimestamp|null} [revisionCreateTime] OSPolicyAssignment revisionCreateTime + * @property {string|null} [etag] OSPolicyAssignment etag + * @property {google.cloud.osconfig.v1alpha.OSPolicyAssignment.RolloutState|null} [rolloutState] OSPolicyAssignment rolloutState + * @property {boolean|null} [baseline] OSPolicyAssignment baseline + * @property {boolean|null} [deleted] OSPolicyAssignment deleted + * @property {boolean|null} [reconciling] OSPolicyAssignment reconciling + * @property {string|null} [uid] OSPolicyAssignment uid + */ + + /** + * Constructs a new OSPolicyAssignment. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a OSPolicyAssignment. + * @implements IOSPolicyAssignment + * @constructor + * @param {google.cloud.osconfig.v1alpha.IOSPolicyAssignment=} [properties] Properties to set + */ + function OSPolicyAssignment(properties) { + this.osPolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyAssignment name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.name = ""; + + /** + * OSPolicyAssignment description. + * @member {string} description + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.description = ""; + + /** + * OSPolicyAssignment osPolicies. + * @member {Array.} osPolicies + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.osPolicies = $util.emptyArray; + + /** + * OSPolicyAssignment instanceFilter. + * @member {google.cloud.osconfig.v1alpha.OSPolicyAssignment.IInstanceFilter|null|undefined} instanceFilter + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.instanceFilter = null; + + /** + * OSPolicyAssignment rollout. + * @member {google.cloud.osconfig.v1alpha.OSPolicyAssignment.IRollout|null|undefined} rollout + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.rollout = null; + + /** + * OSPolicyAssignment revisionId. + * @member {string} revisionId + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.revisionId = ""; + + /** + * OSPolicyAssignment revisionCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} revisionCreateTime + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.revisionCreateTime = null; + + /** + * OSPolicyAssignment etag. + * @member {string} etag + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.etag = ""; + + /** + * OSPolicyAssignment rolloutState. + * @member {google.cloud.osconfig.v1alpha.OSPolicyAssignment.RolloutState} rolloutState + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.rolloutState = 0; + + /** + * OSPolicyAssignment baseline. + * @member {boolean} baseline + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.baseline = false; + + /** + * OSPolicyAssignment deleted. + * @member {boolean} deleted + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.deleted = false; + + /** + * OSPolicyAssignment reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.reconciling = false; + + /** + * OSPolicyAssignment uid. + * @member {string} uid + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + */ + OSPolicyAssignment.prototype.uid = ""; + + /** + * Creates a new OSPolicyAssignment instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyAssignment=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment} OSPolicyAssignment instance + */ + OSPolicyAssignment.create = function create(properties) { + return new OSPolicyAssignment(properties); + }; + + /** + * Encodes the specified OSPolicyAssignment message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyAssignment} message OSPolicyAssignment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyAssignment.encode = function encode(message, writer) { + if (!writer) + 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.osPolicies != null && message.osPolicies.length) + for (var i = 0; i < message.osPolicies.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicy.encode(message.osPolicies[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.instanceFilter != null && Object.hasOwnProperty.call(message, "instanceFilter")) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.encode(message.instanceFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout.encode(message.rollout, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.revisionId); + if (message.revisionCreateTime != null && Object.hasOwnProperty.call(message, "revisionCreateTime")) + $root.google.protobuf.Timestamp.encode(message.revisionCreateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.etag); + if (message.rolloutState != null && Object.hasOwnProperty.call(message, "rolloutState")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.rolloutState); + if (message.baseline != null && Object.hasOwnProperty.call(message, "baseline")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.baseline); + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deleted); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.reconciling); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.uid); + return writer; + }; + + /** + * Encodes the specified OSPolicyAssignment message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyAssignment} message OSPolicyAssignment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyAssignment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyAssignment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment} OSPolicyAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyAssignment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + if (!(message.osPolicies && message.osPolicies.length)) + message.osPolicies = []; + message.osPolicies.push($root.google.cloud.osconfig.v1alpha.OSPolicy.decode(reader, reader.uint32())); + break; + } + case 4: { + message.instanceFilter = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.rollout = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout.decode(reader, reader.uint32()); + break; + } + case 6: { + message.revisionId = reader.string(); + break; + } + case 7: { + message.revisionCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.etag = reader.string(); + break; + } + case 9: { + message.rolloutState = reader.int32(); + break; + } + case 10: { + message.baseline = reader.bool(); + break; + } + case 11: { + message.deleted = reader.bool(); + break; + } + case 12: { + message.reconciling = reader.bool(); + break; + } + case 13: { + message.uid = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyAssignment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment} OSPolicyAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyAssignment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyAssignment message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyAssignment.verify = function verify(message) { + if (typeof message !== "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.osPolicies != null && message.hasOwnProperty("osPolicies")) { + if (!Array.isArray(message.osPolicies)) + return "osPolicies: array expected"; + for (var i = 0; i < message.osPolicies.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicy.verify(message.osPolicies[i]); + if (error) + return "osPolicies." + error; + } + } + if (message.instanceFilter != null && message.hasOwnProperty("instanceFilter")) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.verify(message.instanceFilter); + if (error) + return "instanceFilter." + error; + } + if (message.rollout != null && message.hasOwnProperty("rollout")) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout.verify(message.rollout); + if (error) + return "rollout." + error; + } + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revisionCreateTime); + if (error) + return "revisionCreateTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.rolloutState != null && message.hasOwnProperty("rolloutState")) + switch (message.rolloutState) { + default: + return "rolloutState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.baseline != null && message.hasOwnProperty("baseline")) + if (typeof message.baseline !== "boolean") + return "baseline: boolean expected"; + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + return null; + }; + + /** + * Creates a OSPolicyAssignment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment} OSPolicyAssignment + */ + OSPolicyAssignment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.osPolicies) { + if (!Array.isArray(object.osPolicies)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.osPolicies: array expected"); + message.osPolicies = []; + for (var i = 0; i < object.osPolicies.length; ++i) { + if (typeof object.osPolicies[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.osPolicies: object expected"); + message.osPolicies[i] = $root.google.cloud.osconfig.v1alpha.OSPolicy.fromObject(object.osPolicies[i]); + } + } + if (object.instanceFilter != null) { + if (typeof object.instanceFilter !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.instanceFilter: object expected"); + message.instanceFilter = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.fromObject(object.instanceFilter); + } + if (object.rollout != null) { + if (typeof object.rollout !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.rollout: object expected"); + message.rollout = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout.fromObject(object.rollout); + } + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.revisionCreateTime != null) { + if (typeof object.revisionCreateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.revisionCreateTime: object expected"); + message.revisionCreateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionCreateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + switch (object.rolloutState) { + default: + if (typeof object.rolloutState === "number") { + message.rolloutState = object.rolloutState; + break; + } + break; + case "ROLLOUT_STATE_UNSPECIFIED": + case 0: + message.rolloutState = 0; + break; + case "IN_PROGRESS": + case 1: + message.rolloutState = 1; + break; + case "CANCELLING": + case 2: + message.rolloutState = 2; + break; + case "CANCELLED": + case 3: + message.rolloutState = 3; + break; + case "SUCCEEDED": + case 4: + message.rolloutState = 4; + break; + } + if (object.baseline != null) + message.baseline = Boolean(object.baseline); + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.uid != null) + message.uid = String(object.uid); + return message; + }; + + /** + * Creates a plain object from a OSPolicyAssignment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment} message OSPolicyAssignment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyAssignment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicies = []; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.instanceFilter = null; + object.rollout = null; + object.revisionId = ""; + object.revisionCreateTime = null; + object.etag = ""; + object.rolloutState = options.enums === String ? "ROLLOUT_STATE_UNSPECIFIED" : 0; + object.baseline = false; + object.deleted = false; + object.reconciling = false; + object.uid = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.osPolicies && message.osPolicies.length) { + object.osPolicies = []; + for (var j = 0; j < message.osPolicies.length; ++j) + object.osPolicies[j] = $root.google.cloud.osconfig.v1alpha.OSPolicy.toObject(message.osPolicies[j], options); + } + if (message.instanceFilter != null && message.hasOwnProperty("instanceFilter")) + object.instanceFilter = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.toObject(message.instanceFilter, options); + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout.toObject(message.rollout, options); + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) + object.revisionCreateTime = $root.google.protobuf.Timestamp.toObject(message.revisionCreateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.rolloutState != null && message.hasOwnProperty("rolloutState")) + object.rolloutState = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.RolloutState[message.rolloutState] === undefined ? message.rolloutState : $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.RolloutState[message.rolloutState] : message.rolloutState; + if (message.baseline != null && message.hasOwnProperty("baseline")) + object.baseline = message.baseline; + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + return object; + }; + + /** + * Converts this OSPolicyAssignment to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @instance + * @returns {Object.} JSON object + */ + OSPolicyAssignment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyAssignment + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyAssignment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyAssignment"; + }; + + OSPolicyAssignment.LabelSet = (function() { + + /** + * Properties of a LabelSet. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @interface ILabelSet + * @property {Object.|null} [labels] LabelSet labels + */ + + /** + * Constructs a new LabelSet. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @classdesc Represents a LabelSet. + * @implements ILabelSet + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.ILabelSet=} [properties] Properties to set + */ + function LabelSet(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]]; + } + + /** + * LabelSet labels. + * @member {Object.} labels + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet + * @instance + */ + LabelSet.prototype.labels = $util.emptyObject; + + /** + * Creates a new LabelSet instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.ILabelSet=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet} LabelSet instance + */ + LabelSet.create = function create(properties) { + return new LabelSet(properties); + }; + + /** + * Encodes the specified LabelSet message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.ILabelSet} message LabelSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelSet message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.ILabelSet} message LabelSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet} LabelSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet} LabelSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelSet message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a LabelSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet} LabelSet + */ + LabelSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a LabelSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet} message LabelSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this LabelSet to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet + * @instance + * @returns {Object.} JSON object + */ + LabelSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelSet + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet"; + }; + + return LabelSet; + })(); + + OSPolicyAssignment.InstanceFilter = (function() { + + /** + * Properties of an InstanceFilter. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @interface IInstanceFilter + * @property {boolean|null} [all] InstanceFilter all + * @property {Array.|null} [osShortNames] InstanceFilter osShortNames + * @property {Array.|null} [inclusionLabels] InstanceFilter inclusionLabels + * @property {Array.|null} [exclusionLabels] InstanceFilter exclusionLabels + * @property {Array.|null} [inventories] InstanceFilter inventories + */ + + /** + * Constructs a new InstanceFilter. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @classdesc Represents an InstanceFilter. + * @implements IInstanceFilter + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.IInstanceFilter=} [properties] Properties to set + */ + function InstanceFilter(properties) { + this.osShortNames = []; + this.inclusionLabels = []; + this.exclusionLabels = []; + this.inventories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceFilter all. + * @member {boolean} all + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @instance + */ + InstanceFilter.prototype.all = false; + + /** + * InstanceFilter osShortNames. + * @member {Array.} osShortNames + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @instance + */ + InstanceFilter.prototype.osShortNames = $util.emptyArray; + + /** + * InstanceFilter inclusionLabels. + * @member {Array.} inclusionLabels + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @instance + */ + InstanceFilter.prototype.inclusionLabels = $util.emptyArray; + + /** + * InstanceFilter exclusionLabels. + * @member {Array.} exclusionLabels + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @instance + */ + InstanceFilter.prototype.exclusionLabels = $util.emptyArray; + + /** + * InstanceFilter inventories. + * @member {Array.} inventories + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @instance + */ + InstanceFilter.prototype.inventories = $util.emptyArray; + + /** + * Creates a new InstanceFilter instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.IInstanceFilter=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter} InstanceFilter instance + */ + InstanceFilter.create = function create(properties) { + return new InstanceFilter(properties); + }; + + /** + * Encodes the specified InstanceFilter message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.IInstanceFilter} message InstanceFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.all != null && Object.hasOwnProperty.call(message, "all")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.all); + if (message.osShortNames != null && message.osShortNames.length) + for (var i = 0; i < message.osShortNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.osShortNames[i]); + if (message.inclusionLabels != null && message.inclusionLabels.length) + for (var i = 0; i < message.inclusionLabels.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.encode(message.inclusionLabels[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.exclusionLabels != null && message.exclusionLabels.length) + for (var i = 0; i < message.exclusionLabels.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.encode(message.exclusionLabels[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inventories != null && message.inventories.length) + for (var i = 0; i < message.inventories.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory.encode(message.inventories[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceFilter message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.IInstanceFilter} message InstanceFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter} InstanceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.all = reader.bool(); + break; + } + case 2: { + if (!(message.osShortNames && message.osShortNames.length)) + message.osShortNames = []; + message.osShortNames.push(reader.string()); + break; + } + case 3: { + if (!(message.inclusionLabels && message.inclusionLabels.length)) + message.inclusionLabels = []; + message.inclusionLabels.push($root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.exclusionLabels && message.exclusionLabels.length)) + message.exclusionLabels = []; + message.exclusionLabels.push($root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.inventories && message.inventories.length)) + message.inventories = []; + message.inventories.push($root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter} InstanceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceFilter message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.all != null && message.hasOwnProperty("all")) + if (typeof message.all !== "boolean") + return "all: boolean expected"; + if (message.osShortNames != null && message.hasOwnProperty("osShortNames")) { + if (!Array.isArray(message.osShortNames)) + return "osShortNames: array expected"; + for (var i = 0; i < message.osShortNames.length; ++i) + if (!$util.isString(message.osShortNames[i])) + return "osShortNames: string[] expected"; + } + if (message.inclusionLabels != null && message.hasOwnProperty("inclusionLabels")) { + if (!Array.isArray(message.inclusionLabels)) + return "inclusionLabels: array expected"; + for (var i = 0; i < message.inclusionLabels.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.verify(message.inclusionLabels[i]); + if (error) + return "inclusionLabels." + error; + } + } + if (message.exclusionLabels != null && message.hasOwnProperty("exclusionLabels")) { + if (!Array.isArray(message.exclusionLabels)) + return "exclusionLabels: array expected"; + for (var i = 0; i < message.exclusionLabels.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.verify(message.exclusionLabels[i]); + if (error) + return "exclusionLabels." + error; + } + } + if (message.inventories != null && message.hasOwnProperty("inventories")) { + if (!Array.isArray(message.inventories)) + return "inventories: array expected"; + for (var i = 0; i < message.inventories.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory.verify(message.inventories[i]); + if (error) + return "inventories." + error; + } + } + return null; + }; + + /** + * Creates an InstanceFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter} InstanceFilter + */ + InstanceFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter(); + if (object.all != null) + message.all = Boolean(object.all); + if (object.osShortNames) { + if (!Array.isArray(object.osShortNames)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.osShortNames: array expected"); + message.osShortNames = []; + for (var i = 0; i < object.osShortNames.length; ++i) + message.osShortNames[i] = String(object.osShortNames[i]); + } + if (object.inclusionLabels) { + if (!Array.isArray(object.inclusionLabels)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.inclusionLabels: array expected"); + message.inclusionLabels = []; + for (var i = 0; i < object.inclusionLabels.length; ++i) { + if (typeof object.inclusionLabels[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.inclusionLabels: object expected"); + message.inclusionLabels[i] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.fromObject(object.inclusionLabels[i]); + } + } + if (object.exclusionLabels) { + if (!Array.isArray(object.exclusionLabels)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.exclusionLabels: array expected"); + message.exclusionLabels = []; + for (var i = 0; i < object.exclusionLabels.length; ++i) { + if (typeof object.exclusionLabels[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.exclusionLabels: object expected"); + message.exclusionLabels[i] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.fromObject(object.exclusionLabels[i]); + } + } + if (object.inventories) { + if (!Array.isArray(object.inventories)) + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.inventories: array expected"); + message.inventories = []; + for (var i = 0; i < object.inventories.length; ++i) { + if (typeof object.inventories[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.inventories: object expected"); + message.inventories[i] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory.fromObject(object.inventories[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InstanceFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter} message InstanceFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.osShortNames = []; + object.inclusionLabels = []; + object.exclusionLabels = []; + object.inventories = []; + } + if (options.defaults) + object.all = false; + if (message.all != null && message.hasOwnProperty("all")) + object.all = message.all; + if (message.osShortNames && message.osShortNames.length) { + object.osShortNames = []; + for (var j = 0; j < message.osShortNames.length; ++j) + object.osShortNames[j] = message.osShortNames[j]; + } + if (message.inclusionLabels && message.inclusionLabels.length) { + object.inclusionLabels = []; + for (var j = 0; j < message.inclusionLabels.length; ++j) + object.inclusionLabels[j] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.toObject(message.inclusionLabels[j], options); + } + if (message.exclusionLabels && message.exclusionLabels.length) { + object.exclusionLabels = []; + for (var j = 0; j < message.exclusionLabels.length; ++j) + object.exclusionLabels[j] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.LabelSet.toObject(message.exclusionLabels[j], options); + } + if (message.inventories && message.inventories.length) { + object.inventories = []; + for (var j = 0; j < message.inventories.length; ++j) + object.inventories[j] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory.toObject(message.inventories[j], options); + } + return object; + }; + + /** + * Converts this InstanceFilter to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @instance + * @returns {Object.} JSON object + */ + InstanceFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceFilter + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter"; + }; + + InstanceFilter.Inventory = (function() { + + /** + * Properties of an Inventory. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @interface IInventory + * @property {string|null} [osShortName] Inventory osShortName + * @property {string|null} [osVersion] Inventory osVersion + */ + + /** + * Constructs a new Inventory. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter + * @classdesc Represents an Inventory. + * @implements IInventory + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.IInventory=} [properties] Properties to set + */ + function Inventory(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Inventory osShortName. + * @member {string} osShortName + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory + * @instance + */ + Inventory.prototype.osShortName = ""; + + /** + * Inventory osVersion. + * @member {string} osVersion + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory + * @instance + */ + Inventory.prototype.osVersion = ""; + + /** + * Creates a new Inventory instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.IInventory=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory} Inventory instance + */ + Inventory.create = function create(properties) { + return new Inventory(properties); + }; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osShortName != null && Object.hasOwnProperty.call(message, "osShortName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.osShortName); + if (message.osVersion != null && Object.hasOwnProperty.call(message, "osVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.osVersion); + return writer; + }; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osShortName = reader.string(); + break; + } + case 2: { + message.osVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Inventory message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Inventory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osShortName != null && message.hasOwnProperty("osShortName")) + if (!$util.isString(message.osShortName)) + return "osShortName: string expected"; + if (message.osVersion != null && message.hasOwnProperty("osVersion")) + if (!$util.isString(message.osVersion)) + return "osVersion: string expected"; + return null; + }; + + /** + * Creates an Inventory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory} Inventory + */ + Inventory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory(); + if (object.osShortName != null) + message.osShortName = String(object.osShortName); + if (object.osVersion != null) + message.osVersion = String(object.osVersion); + return message; + }; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory} message Inventory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Inventory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osShortName = ""; + object.osVersion = ""; + } + if (message.osShortName != null && message.hasOwnProperty("osShortName")) + object.osShortName = message.osShortName; + if (message.osVersion != null && message.hasOwnProperty("osVersion")) + object.osVersion = message.osVersion; + return object; + }; + + /** + * Converts this Inventory to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory + * @instance + * @returns {Object.} JSON object + */ + Inventory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Inventory + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Inventory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyAssignment.InstanceFilter.Inventory"; + }; + + return Inventory; + })(); + + return InstanceFilter; + })(); + + OSPolicyAssignment.Rollout = (function() { + + /** + * Properties of a Rollout. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @interface IRollout + * @property {google.cloud.osconfig.v1alpha.IFixedOrPercent|null} [disruptionBudget] Rollout disruptionBudget + * @property {google.protobuf.IDuration|null} [minWaitDuration] Rollout minWaitDuration + */ + + /** + * Constructs a new Rollout. + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment + * @classdesc Represents a Rollout. + * @implements IRollout + * @constructor + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.IRollout=} [properties] Properties to set + */ + function Rollout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Rollout disruptionBudget. + * @member {google.cloud.osconfig.v1alpha.IFixedOrPercent|null|undefined} disruptionBudget + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout + * @instance + */ + Rollout.prototype.disruptionBudget = null; + + /** + * Rollout minWaitDuration. + * @member {google.protobuf.IDuration|null|undefined} minWaitDuration + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout + * @instance + */ + Rollout.prototype.minWaitDuration = null; + + /** + * Creates a new Rollout instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.IRollout=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout} Rollout instance + */ + Rollout.create = function create(properties) { + return new Rollout(properties); + }; + + /** + * Encodes the specified Rollout message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.IRollout} message Rollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rollout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disruptionBudget != null && Object.hasOwnProperty.call(message, "disruptionBudget")) + $root.google.cloud.osconfig.v1alpha.FixedOrPercent.encode(message.disruptionBudget, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minWaitDuration != null && Object.hasOwnProperty.call(message, "minWaitDuration")) + $root.google.protobuf.Duration.encode(message.minWaitDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Rollout message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.IRollout} message Rollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rollout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Rollout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout} Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rollout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.disruptionBudget = $root.google.cloud.osconfig.v1alpha.FixedOrPercent.decode(reader, reader.uint32()); + break; + } + case 2: { + message.minWaitDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Rollout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout} Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rollout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Rollout message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Rollout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disruptionBudget != null && message.hasOwnProperty("disruptionBudget")) { + var error = $root.google.cloud.osconfig.v1alpha.FixedOrPercent.verify(message.disruptionBudget); + if (error) + return "disruptionBudget." + error; + } + if (message.minWaitDuration != null && message.hasOwnProperty("minWaitDuration")) { + var error = $root.google.protobuf.Duration.verify(message.minWaitDuration); + if (error) + return "minWaitDuration." + error; + } + return null; + }; + + /** + * Creates a Rollout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout} Rollout + */ + Rollout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout(); + if (object.disruptionBudget != null) { + if (typeof object.disruptionBudget !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout.disruptionBudget: object expected"); + message.disruptionBudget = $root.google.cloud.osconfig.v1alpha.FixedOrPercent.fromObject(object.disruptionBudget); + } + if (object.minWaitDuration != null) { + if (typeof object.minWaitDuration !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout.minWaitDuration: object expected"); + message.minWaitDuration = $root.google.protobuf.Duration.fromObject(object.minWaitDuration); + } + return message; + }; + + /** + * Creates a plain object from a Rollout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout} message Rollout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Rollout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disruptionBudget = null; + object.minWaitDuration = null; + } + if (message.disruptionBudget != null && message.hasOwnProperty("disruptionBudget")) + object.disruptionBudget = $root.google.cloud.osconfig.v1alpha.FixedOrPercent.toObject(message.disruptionBudget, options); + if (message.minWaitDuration != null && message.hasOwnProperty("minWaitDuration")) + object.minWaitDuration = $root.google.protobuf.Duration.toObject(message.minWaitDuration, options); + return object; + }; + + /** + * Converts this Rollout to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout + * @instance + * @returns {Object.} JSON object + */ + Rollout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Rollout + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Rollout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyAssignment.Rollout"; + }; + + return Rollout; + })(); + + /** + * RolloutState enum. + * @name google.cloud.osconfig.v1alpha.OSPolicyAssignment.RolloutState + * @enum {number} + * @property {number} ROLLOUT_STATE_UNSPECIFIED=0 ROLLOUT_STATE_UNSPECIFIED value + * @property {number} IN_PROGRESS=1 IN_PROGRESS value + * @property {number} CANCELLING=2 CANCELLING value + * @property {number} CANCELLED=3 CANCELLED value + * @property {number} SUCCEEDED=4 SUCCEEDED value + */ + OSPolicyAssignment.RolloutState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLLOUT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_PROGRESS"] = 1; + values[valuesById[2] = "CANCELLING"] = 2; + values[valuesById[3] = "CANCELLED"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + return values; + })(); + + return OSPolicyAssignment; + })(); + + v1alpha.OSPolicyAssignmentOperationMetadata = (function() { + + /** + * Properties of a OSPolicyAssignmentOperationMetadata. + * @memberof google.cloud.osconfig.v1alpha + * @interface IOSPolicyAssignmentOperationMetadata + * @property {string|null} [osPolicyAssignment] OSPolicyAssignmentOperationMetadata osPolicyAssignment + * @property {google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.APIMethod|null} [apiMethod] OSPolicyAssignmentOperationMetadata apiMethod + * @property {google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.RolloutState|null} [rolloutState] OSPolicyAssignmentOperationMetadata rolloutState + * @property {google.protobuf.ITimestamp|null} [rolloutStartTime] OSPolicyAssignmentOperationMetadata rolloutStartTime + * @property {google.protobuf.ITimestamp|null} [rolloutUpdateTime] OSPolicyAssignmentOperationMetadata rolloutUpdateTime + */ + + /** + * Constructs a new OSPolicyAssignmentOperationMetadata. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a OSPolicyAssignmentOperationMetadata. + * @implements IOSPolicyAssignmentOperationMetadata + * @constructor + * @param {google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata=} [properties] Properties to set + */ + function OSPolicyAssignmentOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OSPolicyAssignmentOperationMetadata osPolicyAssignment. + * @member {string} osPolicyAssignment + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @instance + */ + OSPolicyAssignmentOperationMetadata.prototype.osPolicyAssignment = ""; + + /** + * OSPolicyAssignmentOperationMetadata apiMethod. + * @member {google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.APIMethod} apiMethod + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @instance + */ + OSPolicyAssignmentOperationMetadata.prototype.apiMethod = 0; + + /** + * OSPolicyAssignmentOperationMetadata rolloutState. + * @member {google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.RolloutState} rolloutState + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @instance + */ + OSPolicyAssignmentOperationMetadata.prototype.rolloutState = 0; + + /** + * OSPolicyAssignmentOperationMetadata rolloutStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} rolloutStartTime + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @instance + */ + OSPolicyAssignmentOperationMetadata.prototype.rolloutStartTime = null; + + /** + * OSPolicyAssignmentOperationMetadata rolloutUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} rolloutUpdateTime + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @instance + */ + OSPolicyAssignmentOperationMetadata.prototype.rolloutUpdateTime = null; + + /** + * Creates a new OSPolicyAssignmentOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata} OSPolicyAssignmentOperationMetadata instance + */ + OSPolicyAssignmentOperationMetadata.create = function create(properties) { + return new OSPolicyAssignmentOperationMetadata(properties); + }; + + /** + * Encodes the specified OSPolicyAssignmentOperationMetadata message. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata} message OSPolicyAssignmentOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyAssignmentOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyAssignment != null && Object.hasOwnProperty.call(message, "osPolicyAssignment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.osPolicyAssignment); + if (message.apiMethod != null && Object.hasOwnProperty.call(message, "apiMethod")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.apiMethod); + if (message.rolloutState != null && Object.hasOwnProperty.call(message, "rolloutState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.rolloutState); + if (message.rolloutStartTime != null && Object.hasOwnProperty.call(message, "rolloutStartTime")) + $root.google.protobuf.Timestamp.encode(message.rolloutStartTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rolloutUpdateTime != null && Object.hasOwnProperty.call(message, "rolloutUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.rolloutUpdateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OSPolicyAssignmentOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @static + * @param {google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata} message OSPolicyAssignmentOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OSPolicyAssignmentOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OSPolicyAssignmentOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata} OSPolicyAssignmentOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyAssignmentOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osPolicyAssignment = reader.string(); + break; + } + case 2: { + message.apiMethod = reader.int32(); + break; + } + case 3: { + message.rolloutState = reader.int32(); + break; + } + case 4: { + message.rolloutStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.rolloutUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OSPolicyAssignmentOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata} OSPolicyAssignmentOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OSPolicyAssignmentOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OSPolicyAssignmentOperationMetadata message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OSPolicyAssignmentOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + if (!$util.isString(message.osPolicyAssignment)) + return "osPolicyAssignment: string expected"; + if (message.apiMethod != null && message.hasOwnProperty("apiMethod")) + switch (message.apiMethod) { + default: + return "apiMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.rolloutState != null && message.hasOwnProperty("rolloutState")) + switch (message.rolloutState) { + default: + return "rolloutState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.rolloutStartTime != null && message.hasOwnProperty("rolloutStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.rolloutStartTime); + if (error) + return "rolloutStartTime." + error; + } + if (message.rolloutUpdateTime != null && message.hasOwnProperty("rolloutUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.rolloutUpdateTime); + if (error) + return "rolloutUpdateTime." + error; + } + return null; + }; + + /** + * Creates a OSPolicyAssignmentOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata} OSPolicyAssignmentOperationMetadata + */ + OSPolicyAssignmentOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata(); + if (object.osPolicyAssignment != null) + message.osPolicyAssignment = String(object.osPolicyAssignment); + switch (object.apiMethod) { + default: + if (typeof object.apiMethod === "number") { + message.apiMethod = object.apiMethod; + break; + } + break; + case "API_METHOD_UNSPECIFIED": + case 0: + message.apiMethod = 0; + break; + case "CREATE": + case 1: + message.apiMethod = 1; + break; + case "UPDATE": + case 2: + message.apiMethod = 2; + break; + case "DELETE": + case 3: + message.apiMethod = 3; + break; + } + switch (object.rolloutState) { + default: + if (typeof object.rolloutState === "number") { + message.rolloutState = object.rolloutState; + break; + } + break; + case "ROLLOUT_STATE_UNSPECIFIED": + case 0: + message.rolloutState = 0; + break; + case "IN_PROGRESS": + case 1: + message.rolloutState = 1; + break; + case "CANCELLING": + case 2: + message.rolloutState = 2; + break; + case "CANCELLED": + case 3: + message.rolloutState = 3; + break; + case "SUCCEEDED": + case 4: + message.rolloutState = 4; + break; + } + if (object.rolloutStartTime != null) { + if (typeof object.rolloutStartTime !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.rolloutStartTime: object expected"); + message.rolloutStartTime = $root.google.protobuf.Timestamp.fromObject(object.rolloutStartTime); + } + if (object.rolloutUpdateTime != null) { + if (typeof object.rolloutUpdateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.rolloutUpdateTime: object expected"); + message.rolloutUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.rolloutUpdateTime); + } + return message; + }; + + /** + * Creates a plain object from a OSPolicyAssignmentOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @static + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata} message OSPolicyAssignmentOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OSPolicyAssignmentOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osPolicyAssignment = ""; + object.apiMethod = options.enums === String ? "API_METHOD_UNSPECIFIED" : 0; + object.rolloutState = options.enums === String ? "ROLLOUT_STATE_UNSPECIFIED" : 0; + object.rolloutStartTime = null; + object.rolloutUpdateTime = null; + } + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + object.osPolicyAssignment = message.osPolicyAssignment; + if (message.apiMethod != null && message.hasOwnProperty("apiMethod")) + object.apiMethod = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.APIMethod[message.apiMethod] === undefined ? message.apiMethod : $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.APIMethod[message.apiMethod] : message.apiMethod; + if (message.rolloutState != null && message.hasOwnProperty("rolloutState")) + object.rolloutState = options.enums === String ? $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.RolloutState[message.rolloutState] === undefined ? message.rolloutState : $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.RolloutState[message.rolloutState] : message.rolloutState; + if (message.rolloutStartTime != null && message.hasOwnProperty("rolloutStartTime")) + object.rolloutStartTime = $root.google.protobuf.Timestamp.toObject(message.rolloutStartTime, options); + if (message.rolloutUpdateTime != null && message.hasOwnProperty("rolloutUpdateTime")) + object.rolloutUpdateTime = $root.google.protobuf.Timestamp.toObject(message.rolloutUpdateTime, options); + return object; + }; + + /** + * Converts this OSPolicyAssignmentOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OSPolicyAssignmentOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OSPolicyAssignmentOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OSPolicyAssignmentOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata"; + }; + + /** + * APIMethod enum. + * @name google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.APIMethod + * @enum {number} + * @property {number} API_METHOD_UNSPECIFIED=0 API_METHOD_UNSPECIFIED value + * @property {number} CREATE=1 CREATE value + * @property {number} UPDATE=2 UPDATE value + * @property {number} DELETE=3 DELETE value + */ + OSPolicyAssignmentOperationMetadata.APIMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "API_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATE"] = 1; + values[valuesById[2] = "UPDATE"] = 2; + values[valuesById[3] = "DELETE"] = 3; + return values; + })(); + + /** + * RolloutState enum. + * @name google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata.RolloutState + * @enum {number} + * @property {number} ROLLOUT_STATE_UNSPECIFIED=0 ROLLOUT_STATE_UNSPECIFIED value + * @property {number} IN_PROGRESS=1 IN_PROGRESS value + * @property {number} CANCELLING=2 CANCELLING value + * @property {number} CANCELLED=3 CANCELLED value + * @property {number} SUCCEEDED=4 SUCCEEDED value + */ + OSPolicyAssignmentOperationMetadata.RolloutState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLLOUT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_PROGRESS"] = 1; + values[valuesById[2] = "CANCELLING"] = 2; + values[valuesById[3] = "CANCELLED"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + return values; + })(); + + return OSPolicyAssignmentOperationMetadata; + })(); + + v1alpha.CreateOSPolicyAssignmentRequest = (function() { + + /** + * Properties of a CreateOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface ICreateOSPolicyAssignmentRequest + * @property {string|null} [parent] CreateOSPolicyAssignmentRequest parent + * @property {google.cloud.osconfig.v1alpha.IOSPolicyAssignment|null} [osPolicyAssignment] CreateOSPolicyAssignmentRequest osPolicyAssignment + * @property {string|null} [osPolicyAssignmentId] CreateOSPolicyAssignmentRequest osPolicyAssignmentId + */ + + /** + * Constructs a new CreateOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a CreateOSPolicyAssignmentRequest. + * @implements ICreateOSPolicyAssignmentRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest=} [properties] Properties to set + */ + function CreateOSPolicyAssignmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateOSPolicyAssignmentRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest + * @instance + */ + CreateOSPolicyAssignmentRequest.prototype.parent = ""; + + /** + * CreateOSPolicyAssignmentRequest osPolicyAssignment. + * @member {google.cloud.osconfig.v1alpha.IOSPolicyAssignment|null|undefined} osPolicyAssignment + * @memberof google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest + * @instance + */ + CreateOSPolicyAssignmentRequest.prototype.osPolicyAssignment = null; + + /** + * CreateOSPolicyAssignmentRequest osPolicyAssignmentId. + * @member {string} osPolicyAssignmentId + * @memberof google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest + * @instance + */ + CreateOSPolicyAssignmentRequest.prototype.osPolicyAssignmentId = ""; + + /** + * Creates a new CreateOSPolicyAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest} CreateOSPolicyAssignmentRequest instance + */ + CreateOSPolicyAssignmentRequest.create = function create(properties) { + return new CreateOSPolicyAssignmentRequest(properties); + }; + + /** + * Encodes the specified CreateOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest} message CreateOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateOSPolicyAssignmentRequest.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.osPolicyAssignment != null && Object.hasOwnProperty.call(message, "osPolicyAssignment")) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.encode(message.osPolicyAssignment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.osPolicyAssignmentId != null && Object.hasOwnProperty.call(message, "osPolicyAssignmentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.osPolicyAssignmentId); + return writer; + }; + + /** + * Encodes the specified CreateOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest} message CreateOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateOSPolicyAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateOSPolicyAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest} CreateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateOSPolicyAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.osPolicyAssignment = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.decode(reader, reader.uint32()); + break; + } + case 3: { + message.osPolicyAssignmentId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest} CreateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateOSPolicyAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateOSPolicyAssignmentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateOSPolicyAssignmentRequest.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.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.verify(message.osPolicyAssignment); + if (error) + return "osPolicyAssignment." + error; + } + if (message.osPolicyAssignmentId != null && message.hasOwnProperty("osPolicyAssignmentId")) + if (!$util.isString(message.osPolicyAssignmentId)) + return "osPolicyAssignmentId: string expected"; + return null; + }; + + /** + * Creates a CreateOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest} CreateOSPolicyAssignmentRequest + */ + CreateOSPolicyAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.osPolicyAssignment != null) { + if (typeof object.osPolicyAssignment !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest.osPolicyAssignment: object expected"); + message.osPolicyAssignment = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.fromObject(object.osPolicyAssignment); + } + if (object.osPolicyAssignmentId != null) + message.osPolicyAssignmentId = String(object.osPolicyAssignmentId); + return message; + }; + + /** + * Creates a plain object from a CreateOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest} message CreateOSPolicyAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateOSPolicyAssignmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.osPolicyAssignment = null; + object.osPolicyAssignmentId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + object.osPolicyAssignment = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.toObject(message.osPolicyAssignment, options); + if (message.osPolicyAssignmentId != null && message.hasOwnProperty("osPolicyAssignmentId")) + object.osPolicyAssignmentId = message.osPolicyAssignmentId; + return object; + }; + + /** + * Converts this CreateOSPolicyAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateOSPolicyAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateOSPolicyAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateOSPolicyAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest"; + }; + + return CreateOSPolicyAssignmentRequest; + })(); + + v1alpha.UpdateOSPolicyAssignmentRequest = (function() { + + /** + * Properties of an UpdateOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface IUpdateOSPolicyAssignmentRequest + * @property {google.cloud.osconfig.v1alpha.IOSPolicyAssignment|null} [osPolicyAssignment] UpdateOSPolicyAssignmentRequest osPolicyAssignment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOSPolicyAssignmentRequest updateMask + */ + + /** + * Constructs a new UpdateOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents an UpdateOSPolicyAssignmentRequest. + * @implements IUpdateOSPolicyAssignmentRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest=} [properties] Properties to set + */ + function UpdateOSPolicyAssignmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateOSPolicyAssignmentRequest osPolicyAssignment. + * @member {google.cloud.osconfig.v1alpha.IOSPolicyAssignment|null|undefined} osPolicyAssignment + * @memberof google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest + * @instance + */ + UpdateOSPolicyAssignmentRequest.prototype.osPolicyAssignment = null; + + /** + * UpdateOSPolicyAssignmentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest + * @instance + */ + UpdateOSPolicyAssignmentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateOSPolicyAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest} UpdateOSPolicyAssignmentRequest instance + */ + UpdateOSPolicyAssignmentRequest.create = function create(properties) { + return new UpdateOSPolicyAssignmentRequest(properties); + }; + + /** + * Encodes the specified UpdateOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest} message UpdateOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOSPolicyAssignmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyAssignment != null && Object.hasOwnProperty.call(message, "osPolicyAssignment")) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.encode(message.osPolicyAssignment, 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 UpdateOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest} message UpdateOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOSPolicyAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateOSPolicyAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest} UpdateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOSPolicyAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osPolicyAssignment = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.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 UpdateOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest} UpdateOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOSPolicyAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateOSPolicyAssignmentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateOSPolicyAssignmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.verify(message.osPolicyAssignment); + if (error) + return "osPolicyAssignment." + 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 UpdateOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest} UpdateOSPolicyAssignmentRequest + */ + UpdateOSPolicyAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest(); + if (object.osPolicyAssignment != null) { + if (typeof object.osPolicyAssignment !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest.osPolicyAssignment: object expected"); + message.osPolicyAssignment = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.fromObject(object.osPolicyAssignment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest} message UpdateOSPolicyAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateOSPolicyAssignmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osPolicyAssignment = null; + object.updateMask = null; + } + if (message.osPolicyAssignment != null && message.hasOwnProperty("osPolicyAssignment")) + object.osPolicyAssignment = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.toObject(message.osPolicyAssignment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateOSPolicyAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOSPolicyAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateOSPolicyAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateOSPolicyAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest"; + }; + + return UpdateOSPolicyAssignmentRequest; + })(); + + v1alpha.GetOSPolicyAssignmentRequest = (function() { + + /** + * Properties of a GetOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface IGetOSPolicyAssignmentRequest + * @property {string|null} [name] GetOSPolicyAssignmentRequest name + */ + + /** + * Constructs a new GetOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a GetOSPolicyAssignmentRequest. + * @implements IGetOSPolicyAssignmentRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest=} [properties] Properties to set + */ + function GetOSPolicyAssignmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOSPolicyAssignmentRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest + * @instance + */ + GetOSPolicyAssignmentRequest.prototype.name = ""; + + /** + * Creates a new GetOSPolicyAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest} GetOSPolicyAssignmentRequest instance + */ + GetOSPolicyAssignmentRequest.create = function create(properties) { + return new GetOSPolicyAssignmentRequest(properties); + }; + + /** + * Encodes the specified GetOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest} message GetOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOSPolicyAssignmentRequest.encode = function encode(message, writer) { + 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 GetOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest} message GetOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOSPolicyAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOSPolicyAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest} GetOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOSPolicyAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest(); + 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 GetOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest} GetOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOSPolicyAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOSPolicyAssignmentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOSPolicyAssignmentRequest.verify = function verify(message) { + if (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 GetOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest} GetOSPolicyAssignmentRequest + */ + GetOSPolicyAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest} message GetOSPolicyAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOSPolicyAssignmentRequest.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 GetOSPolicyAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + GetOSPolicyAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOSPolicyAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOSPolicyAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest"; + }; + + return GetOSPolicyAssignmentRequest; + })(); + + v1alpha.ListOSPolicyAssignmentsRequest = (function() { + + /** + * Properties of a ListOSPolicyAssignmentsRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface IListOSPolicyAssignmentsRequest + * @property {string|null} [parent] ListOSPolicyAssignmentsRequest parent + * @property {number|null} [pageSize] ListOSPolicyAssignmentsRequest pageSize + * @property {string|null} [pageToken] ListOSPolicyAssignmentsRequest pageToken + */ + + /** + * Constructs a new ListOSPolicyAssignmentsRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a ListOSPolicyAssignmentsRequest. + * @implements IListOSPolicyAssignmentsRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest=} [properties] Properties to set + */ + function ListOSPolicyAssignmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOSPolicyAssignmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest + * @instance + */ + ListOSPolicyAssignmentsRequest.prototype.parent = ""; + + /** + * ListOSPolicyAssignmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest + * @instance + */ + ListOSPolicyAssignmentsRequest.prototype.pageSize = 0; + + /** + * ListOSPolicyAssignmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest + * @instance + */ + ListOSPolicyAssignmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOSPolicyAssignmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest} ListOSPolicyAssignmentsRequest instance + */ + ListOSPolicyAssignmentsRequest.create = function create(properties) { + return new ListOSPolicyAssignmentsRequest(properties); + }; + + /** + * Encodes the specified ListOSPolicyAssignmentsRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest} message ListOSPolicyAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentsRequest.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 ListOSPolicyAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest} message ListOSPolicyAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOSPolicyAssignmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest} ListOSPolicyAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest(); + 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 ListOSPolicyAssignmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest} ListOSPolicyAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOSPolicyAssignmentsRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOSPolicyAssignmentsRequest.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 ListOSPolicyAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest} ListOSPolicyAssignmentsRequest + */ + ListOSPolicyAssignmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest(); + 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 ListOSPolicyAssignmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest} message ListOSPolicyAssignmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOSPolicyAssignmentsRequest.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 ListOSPolicyAssignmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOSPolicyAssignmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOSPolicyAssignmentsRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOSPolicyAssignmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest"; + }; + + return ListOSPolicyAssignmentsRequest; + })(); + + v1alpha.ListOSPolicyAssignmentsResponse = (function() { + + /** + * Properties of a ListOSPolicyAssignmentsResponse. + * @memberof google.cloud.osconfig.v1alpha + * @interface IListOSPolicyAssignmentsResponse + * @property {Array.|null} [osPolicyAssignments] ListOSPolicyAssignmentsResponse osPolicyAssignments + * @property {string|null} [nextPageToken] ListOSPolicyAssignmentsResponse nextPageToken + */ + + /** + * Constructs a new ListOSPolicyAssignmentsResponse. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a ListOSPolicyAssignmentsResponse. + * @implements IListOSPolicyAssignmentsResponse + * @constructor + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse=} [properties] Properties to set + */ + function ListOSPolicyAssignmentsResponse(properties) { + this.osPolicyAssignments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOSPolicyAssignmentsResponse osPolicyAssignments. + * @member {Array.} osPolicyAssignments + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse + * @instance + */ + ListOSPolicyAssignmentsResponse.prototype.osPolicyAssignments = $util.emptyArray; + + /** + * ListOSPolicyAssignmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse + * @instance + */ + ListOSPolicyAssignmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOSPolicyAssignmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse} ListOSPolicyAssignmentsResponse instance + */ + ListOSPolicyAssignmentsResponse.create = function create(properties) { + return new ListOSPolicyAssignmentsResponse(properties); + }; + + /** + * Encodes the specified ListOSPolicyAssignmentsResponse message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse} message ListOSPolicyAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyAssignments != null && message.osPolicyAssignments.length) + for (var i = 0; i < message.osPolicyAssignments.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.encode(message.osPolicyAssignments[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 ListOSPolicyAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse} message ListOSPolicyAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOSPolicyAssignmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse} ListOSPolicyAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.osPolicyAssignments && message.osPolicyAssignments.length)) + message.osPolicyAssignments = []; + message.osPolicyAssignments.push($root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOSPolicyAssignmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse} ListOSPolicyAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOSPolicyAssignmentsResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOSPolicyAssignmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osPolicyAssignments != null && message.hasOwnProperty("osPolicyAssignments")) { + if (!Array.isArray(message.osPolicyAssignments)) + return "osPolicyAssignments: array expected"; + for (var i = 0; i < message.osPolicyAssignments.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.verify(message.osPolicyAssignments[i]); + if (error) + return "osPolicyAssignments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOSPolicyAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse} ListOSPolicyAssignmentsResponse + */ + ListOSPolicyAssignmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse(); + if (object.osPolicyAssignments) { + if (!Array.isArray(object.osPolicyAssignments)) + throw TypeError(".google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse.osPolicyAssignments: array expected"); + message.osPolicyAssignments = []; + for (var i = 0; i < object.osPolicyAssignments.length; ++i) { + if (typeof object.osPolicyAssignments[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse.osPolicyAssignments: object expected"); + message.osPolicyAssignments[i] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.fromObject(object.osPolicyAssignments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOSPolicyAssignmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse} message ListOSPolicyAssignmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOSPolicyAssignmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicyAssignments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.osPolicyAssignments && message.osPolicyAssignments.length) { + object.osPolicyAssignments = []; + for (var j = 0; j < message.osPolicyAssignments.length; ++j) + object.osPolicyAssignments[j] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.toObject(message.osPolicyAssignments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOSPolicyAssignmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOSPolicyAssignmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOSPolicyAssignmentsResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOSPolicyAssignmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse"; + }; + + return ListOSPolicyAssignmentsResponse; + })(); + + v1alpha.ListOSPolicyAssignmentRevisionsRequest = (function() { + + /** + * Properties of a ListOSPolicyAssignmentRevisionsRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface IListOSPolicyAssignmentRevisionsRequest + * @property {string|null} [name] ListOSPolicyAssignmentRevisionsRequest name + * @property {number|null} [pageSize] ListOSPolicyAssignmentRevisionsRequest pageSize + * @property {string|null} [pageToken] ListOSPolicyAssignmentRevisionsRequest pageToken + */ + + /** + * Constructs a new ListOSPolicyAssignmentRevisionsRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a ListOSPolicyAssignmentRevisionsRequest. + * @implements IListOSPolicyAssignmentRevisionsRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest=} [properties] Properties to set + */ + function ListOSPolicyAssignmentRevisionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOSPolicyAssignmentRevisionsRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest + * @instance + */ + ListOSPolicyAssignmentRevisionsRequest.prototype.name = ""; + + /** + * ListOSPolicyAssignmentRevisionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest + * @instance + */ + ListOSPolicyAssignmentRevisionsRequest.prototype.pageSize = 0; + + /** + * ListOSPolicyAssignmentRevisionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest + * @instance + */ + ListOSPolicyAssignmentRevisionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOSPolicyAssignmentRevisionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest} ListOSPolicyAssignmentRevisionsRequest instance + */ + ListOSPolicyAssignmentRevisionsRequest.create = function create(properties) { + return new ListOSPolicyAssignmentRevisionsRequest(properties); + }; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest} message ListOSPolicyAssignmentRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentRevisionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest} message ListOSPolicyAssignmentRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest} ListOSPolicyAssignmentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentRevisionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest} ListOSPolicyAssignmentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOSPolicyAssignmentRevisionsRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOSPolicyAssignmentRevisionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOSPolicyAssignmentRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest} ListOSPolicyAssignmentRevisionsRequest + */ + ListOSPolicyAssignmentRevisionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOSPolicyAssignmentRevisionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest} message ListOSPolicyAssignmentRevisionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOSPolicyAssignmentRevisionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListOSPolicyAssignmentRevisionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOSPolicyAssignmentRevisionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOSPolicyAssignmentRevisionsRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOSPolicyAssignmentRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest"; + }; + + return ListOSPolicyAssignmentRevisionsRequest; + })(); + + v1alpha.ListOSPolicyAssignmentRevisionsResponse = (function() { + + /** + * Properties of a ListOSPolicyAssignmentRevisionsResponse. + * @memberof google.cloud.osconfig.v1alpha + * @interface IListOSPolicyAssignmentRevisionsResponse + * @property {Array.|null} [osPolicyAssignments] ListOSPolicyAssignmentRevisionsResponse osPolicyAssignments + * @property {string|null} [nextPageToken] ListOSPolicyAssignmentRevisionsResponse nextPageToken + */ + + /** + * Constructs a new ListOSPolicyAssignmentRevisionsResponse. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a ListOSPolicyAssignmentRevisionsResponse. + * @implements IListOSPolicyAssignmentRevisionsResponse + * @constructor + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse=} [properties] Properties to set + */ + function ListOSPolicyAssignmentRevisionsResponse(properties) { + this.osPolicyAssignments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOSPolicyAssignmentRevisionsResponse osPolicyAssignments. + * @member {Array.} osPolicyAssignments + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse + * @instance + */ + ListOSPolicyAssignmentRevisionsResponse.prototype.osPolicyAssignments = $util.emptyArray; + + /** + * ListOSPolicyAssignmentRevisionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse + * @instance + */ + ListOSPolicyAssignmentRevisionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOSPolicyAssignmentRevisionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse} ListOSPolicyAssignmentRevisionsResponse instance + */ + ListOSPolicyAssignmentRevisionsResponse.create = function create(properties) { + return new ListOSPolicyAssignmentRevisionsResponse(properties); + }; + + /** + * Encodes the specified ListOSPolicyAssignmentRevisionsResponse message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse} message ListOSPolicyAssignmentRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentRevisionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osPolicyAssignments != null && message.osPolicyAssignments.length) + for (var i = 0; i < message.osPolicyAssignments.length; ++i) + $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.encode(message.osPolicyAssignments[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 ListOSPolicyAssignmentRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse} message ListOSPolicyAssignmentRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOSPolicyAssignmentRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse} ListOSPolicyAssignmentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentRevisionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.osPolicyAssignments && message.osPolicyAssignments.length)) + message.osPolicyAssignments = []; + message.osPolicyAssignments.push($root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOSPolicyAssignmentRevisionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse} ListOSPolicyAssignmentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOSPolicyAssignmentRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOSPolicyAssignmentRevisionsResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOSPolicyAssignmentRevisionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osPolicyAssignments != null && message.hasOwnProperty("osPolicyAssignments")) { + if (!Array.isArray(message.osPolicyAssignments)) + return "osPolicyAssignments: array expected"; + for (var i = 0; i < message.osPolicyAssignments.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.verify(message.osPolicyAssignments[i]); + if (error) + return "osPolicyAssignments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOSPolicyAssignmentRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse} ListOSPolicyAssignmentRevisionsResponse + */ + ListOSPolicyAssignmentRevisionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse(); + if (object.osPolicyAssignments) { + if (!Array.isArray(object.osPolicyAssignments)) + throw TypeError(".google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse.osPolicyAssignments: array expected"); + message.osPolicyAssignments = []; + for (var i = 0; i < object.osPolicyAssignments.length; ++i) { + if (typeof object.osPolicyAssignments[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse.osPolicyAssignments: object expected"); + message.osPolicyAssignments[i] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.fromObject(object.osPolicyAssignments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOSPolicyAssignmentRevisionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse} message ListOSPolicyAssignmentRevisionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOSPolicyAssignmentRevisionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.osPolicyAssignments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.osPolicyAssignments && message.osPolicyAssignments.length) { + object.osPolicyAssignments = []; + for (var j = 0; j < message.osPolicyAssignments.length; ++j) + object.osPolicyAssignments[j] = $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment.toObject(message.osPolicyAssignments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOSPolicyAssignmentRevisionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOSPolicyAssignmentRevisionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOSPolicyAssignmentRevisionsResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOSPolicyAssignmentRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse"; + }; + + return ListOSPolicyAssignmentRevisionsResponse; + })(); + + v1alpha.DeleteOSPolicyAssignmentRequest = (function() { + + /** + * Properties of a DeleteOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface IDeleteOSPolicyAssignmentRequest + * @property {string|null} [name] DeleteOSPolicyAssignmentRequest name + */ + + /** + * Constructs a new DeleteOSPolicyAssignmentRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a DeleteOSPolicyAssignmentRequest. + * @implements IDeleteOSPolicyAssignmentRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest=} [properties] Properties to set + */ + function DeleteOSPolicyAssignmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOSPolicyAssignmentRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest + * @instance + */ + DeleteOSPolicyAssignmentRequest.prototype.name = ""; + + /** + * Creates a new DeleteOSPolicyAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest} DeleteOSPolicyAssignmentRequest instance + */ + DeleteOSPolicyAssignmentRequest.create = function create(properties) { + return new DeleteOSPolicyAssignmentRequest(properties); + }; + + /** + * Encodes the specified DeleteOSPolicyAssignmentRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest} message DeleteOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOSPolicyAssignmentRequest.encode = function encode(message, writer) { + 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 DeleteOSPolicyAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest} message DeleteOSPolicyAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOSPolicyAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOSPolicyAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest} DeleteOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOSPolicyAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest(); + 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 DeleteOSPolicyAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest} DeleteOSPolicyAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOSPolicyAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOSPolicyAssignmentRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOSPolicyAssignmentRequest.verify = function verify(message) { + if (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 DeleteOSPolicyAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest} DeleteOSPolicyAssignmentRequest + */ + DeleteOSPolicyAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOSPolicyAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest + * @static + * @param {google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest} message DeleteOSPolicyAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOSPolicyAssignmentRequest.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 DeleteOSPolicyAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOSPolicyAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOSPolicyAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOSPolicyAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest"; + }; + + return DeleteOSPolicyAssignmentRequest; + })(); + + v1alpha.FixedOrPercent = (function() { + + /** + * Properties of a FixedOrPercent. + * @memberof google.cloud.osconfig.v1alpha + * @interface IFixedOrPercent + * @property {number|null} [fixed] FixedOrPercent fixed + * @property {number|null} [percent] FixedOrPercent percent + */ + + /** + * Constructs a new FixedOrPercent. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a FixedOrPercent. + * @implements IFixedOrPercent + * @constructor + * @param {google.cloud.osconfig.v1alpha.IFixedOrPercent=} [properties] Properties to set + */ + function FixedOrPercent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FixedOrPercent fixed. + * @member {number|null|undefined} fixed + * @memberof google.cloud.osconfig.v1alpha.FixedOrPercent + * @instance + */ + FixedOrPercent.prototype.fixed = null; + + /** + * FixedOrPercent percent. + * @member {number|null|undefined} percent + * @memberof google.cloud.osconfig.v1alpha.FixedOrPercent + * @instance + */ + FixedOrPercent.prototype.percent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FixedOrPercent mode. + * @member {"fixed"|"percent"|undefined} mode + * @memberof google.cloud.osconfig.v1alpha.FixedOrPercent + * @instance + */ + Object.defineProperty(FixedOrPercent.prototype, "mode", { + get: $util.oneOfGetter($oneOfFields = ["fixed", "percent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FixedOrPercent instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.FixedOrPercent + * @static + * @param {google.cloud.osconfig.v1alpha.IFixedOrPercent=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.FixedOrPercent} FixedOrPercent instance + */ + FixedOrPercent.create = function create(properties) { + return new FixedOrPercent(properties); + }; + + /** + * Encodes the specified FixedOrPercent message. Does not implicitly {@link google.cloud.osconfig.v1alpha.FixedOrPercent.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.FixedOrPercent + * @static + * @param {google.cloud.osconfig.v1alpha.IFixedOrPercent} message FixedOrPercent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedOrPercent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fixed != null && Object.hasOwnProperty.call(message, "fixed")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fixed); + if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.percent); + return writer; + }; + + /** + * Encodes the specified FixedOrPercent message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.FixedOrPercent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.FixedOrPercent + * @static + * @param {google.cloud.osconfig.v1alpha.IFixedOrPercent} message FixedOrPercent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedOrPercent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FixedOrPercent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.FixedOrPercent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.FixedOrPercent} FixedOrPercent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedOrPercent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.FixedOrPercent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fixed = reader.int32(); + break; + } + case 2: { + message.percent = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FixedOrPercent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.FixedOrPercent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.FixedOrPercent} FixedOrPercent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedOrPercent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FixedOrPercent message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.FixedOrPercent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FixedOrPercent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fixed != null && message.hasOwnProperty("fixed")) { + properties.mode = 1; + if (!$util.isInteger(message.fixed)) + return "fixed: integer expected"; + } + if (message.percent != null && message.hasOwnProperty("percent")) { + if (properties.mode === 1) + return "mode: multiple values"; + properties.mode = 1; + if (!$util.isInteger(message.percent)) + return "percent: integer expected"; + } + return null; + }; + + /** + * Creates a FixedOrPercent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.FixedOrPercent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.FixedOrPercent} FixedOrPercent + */ + FixedOrPercent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.FixedOrPercent) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.FixedOrPercent(); + if (object.fixed != null) + message.fixed = object.fixed | 0; + if (object.percent != null) + message.percent = object.percent | 0; + return message; + }; + + /** + * Creates a plain object from a FixedOrPercent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.FixedOrPercent + * @static + * @param {google.cloud.osconfig.v1alpha.FixedOrPercent} message FixedOrPercent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FixedOrPercent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.fixed != null && message.hasOwnProperty("fixed")) { + object.fixed = message.fixed; + if (options.oneofs) + object.mode = "fixed"; + } + if (message.percent != null && message.hasOwnProperty("percent")) { + object.percent = message.percent; + if (options.oneofs) + object.mode = "percent"; + } + return object; + }; + + /** + * Converts this FixedOrPercent to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.FixedOrPercent + * @instance + * @returns {Object.} JSON object + */ + FixedOrPercent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FixedOrPercent + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.FixedOrPercent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedOrPercent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.FixedOrPercent"; + }; + + return FixedOrPercent; + })(); + + v1alpha.OsConfigZonalService = (function() { + + /** + * Constructs a new OsConfigZonalService service. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents an OsConfigZonalService + * @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 OsConfigZonalService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (OsConfigZonalService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = OsConfigZonalService; + + /** + * Creates new OsConfigZonalService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @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 {OsConfigZonalService} RPC service. Useful where requests and/or responses are streamed. + */ + OsConfigZonalService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|createOSPolicyAssignment}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef CreateOSPolicyAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateOSPolicyAssignment. + * @function createOSPolicyAssignment + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest} request CreateOSPolicyAssignmentRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.CreateOSPolicyAssignmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.createOSPolicyAssignment = function createOSPolicyAssignment(request, callback) { + return this.rpcCall(createOSPolicyAssignment, $root.google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateOSPolicyAssignment" }); + + /** + * Calls CreateOSPolicyAssignment. + * @function createOSPolicyAssignment + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest} request CreateOSPolicyAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|updateOSPolicyAssignment}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef UpdateOSPolicyAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateOSPolicyAssignment. + * @function updateOSPolicyAssignment + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest} request UpdateOSPolicyAssignmentRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.UpdateOSPolicyAssignmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.updateOSPolicyAssignment = function updateOSPolicyAssignment(request, callback) { + return this.rpcCall(updateOSPolicyAssignment, $root.google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateOSPolicyAssignment" }); + + /** + * Calls UpdateOSPolicyAssignment. + * @function updateOSPolicyAssignment + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest} request UpdateOSPolicyAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|getOSPolicyAssignment}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef GetOSPolicyAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment} [response] OSPolicyAssignment + */ + + /** + * Calls GetOSPolicyAssignment. + * @function getOSPolicyAssignment + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest} request GetOSPolicyAssignmentRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.GetOSPolicyAssignmentCallback} callback Node-style callback called with the error, if any, and OSPolicyAssignment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.getOSPolicyAssignment = function getOSPolicyAssignment(request, callback) { + return this.rpcCall(getOSPolicyAssignment, $root.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest, $root.google.cloud.osconfig.v1alpha.OSPolicyAssignment, request, callback); + }, "name", { value: "GetOSPolicyAssignment" }); + + /** + * Calls GetOSPolicyAssignment. + * @function getOSPolicyAssignment + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest} request GetOSPolicyAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|listOSPolicyAssignments}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef ListOSPolicyAssignmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse} [response] ListOSPolicyAssignmentsResponse + */ + + /** + * Calls ListOSPolicyAssignments. + * @function listOSPolicyAssignments + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest} request ListOSPolicyAssignmentsRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.ListOSPolicyAssignmentsCallback} callback Node-style callback called with the error, if any, and ListOSPolicyAssignmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.listOSPolicyAssignments = function listOSPolicyAssignments(request, callback) { + return this.rpcCall(listOSPolicyAssignments, $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest, $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse, request, callback); + }, "name", { value: "ListOSPolicyAssignments" }); + + /** + * Calls ListOSPolicyAssignments. + * @function listOSPolicyAssignments + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest} request ListOSPolicyAssignmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|listOSPolicyAssignmentRevisions}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef ListOSPolicyAssignmentRevisionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse} [response] ListOSPolicyAssignmentRevisionsResponse + */ + + /** + * Calls ListOSPolicyAssignmentRevisions. + * @function listOSPolicyAssignmentRevisions + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest} request ListOSPolicyAssignmentRevisionsRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.ListOSPolicyAssignmentRevisionsCallback} callback Node-style callback called with the error, if any, and ListOSPolicyAssignmentRevisionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.listOSPolicyAssignmentRevisions = function listOSPolicyAssignmentRevisions(request, callback) { + return this.rpcCall(listOSPolicyAssignmentRevisions, $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest, $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse, request, callback); + }, "name", { value: "ListOSPolicyAssignmentRevisions" }); + + /** + * Calls ListOSPolicyAssignmentRevisions. + * @function listOSPolicyAssignmentRevisions + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest} request ListOSPolicyAssignmentRevisionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|deleteOSPolicyAssignment}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef DeleteOSPolicyAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteOSPolicyAssignment. + * @function deleteOSPolicyAssignment + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest} request DeleteOSPolicyAssignmentRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.DeleteOSPolicyAssignmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.deleteOSPolicyAssignment = function deleteOSPolicyAssignment(request, callback) { + return this.rpcCall(deleteOSPolicyAssignment, $root.google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteOSPolicyAssignment" }); + + /** + * Calls DeleteOSPolicyAssignment. + * @function deleteOSPolicyAssignment + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest} request DeleteOSPolicyAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|getInstanceOSPoliciesCompliance}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef GetInstanceOSPoliciesComplianceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance} [response] InstanceOSPoliciesCompliance + */ + + /** + * Calls GetInstanceOSPoliciesCompliance. + * @function getInstanceOSPoliciesCompliance + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest} request GetInstanceOSPoliciesComplianceRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.GetInstanceOSPoliciesComplianceCallback} callback Node-style callback called with the error, if any, and InstanceOSPoliciesCompliance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.getInstanceOSPoliciesCompliance = function getInstanceOSPoliciesCompliance(request, callback) { + return this.rpcCall(getInstanceOSPoliciesCompliance, $root.google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest, $root.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance, request, callback); + }, "name", { value: "GetInstanceOSPoliciesCompliance" }); + + /** + * Calls GetInstanceOSPoliciesCompliance. + * @function getInstanceOSPoliciesCompliance + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest} request GetInstanceOSPoliciesComplianceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|listInstanceOSPoliciesCompliances}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef ListInstanceOSPoliciesCompliancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse} [response] ListInstanceOSPoliciesCompliancesResponse + */ + + /** + * Calls ListInstanceOSPoliciesCompliances. + * @function listInstanceOSPoliciesCompliances + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest} request ListInstanceOSPoliciesCompliancesRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.ListInstanceOSPoliciesCompliancesCallback} callback Node-style callback called with the error, if any, and ListInstanceOSPoliciesCompliancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.listInstanceOSPoliciesCompliances = function listInstanceOSPoliciesCompliances(request, callback) { + return this.rpcCall(listInstanceOSPoliciesCompliances, $root.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest, $root.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse, request, callback); + }, "name", { value: "ListInstanceOSPoliciesCompliances" }); + + /** + * Calls ListInstanceOSPoliciesCompliances. + * @function listInstanceOSPoliciesCompliances + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest} request ListInstanceOSPoliciesCompliancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|getOSPolicyAssignmentReport}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef GetOSPolicyAssignmentReportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport} [response] OSPolicyAssignmentReport + */ + + /** + * Calls GetOSPolicyAssignmentReport. + * @function getOSPolicyAssignmentReport + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest} request GetOSPolicyAssignmentReportRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.GetOSPolicyAssignmentReportCallback} callback Node-style callback called with the error, if any, and OSPolicyAssignmentReport + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.getOSPolicyAssignmentReport = function getOSPolicyAssignmentReport(request, callback) { + return this.rpcCall(getOSPolicyAssignmentReport, $root.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest, $root.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport, request, callback); + }, "name", { value: "GetOSPolicyAssignmentReport" }); + + /** + * Calls GetOSPolicyAssignmentReport. + * @function getOSPolicyAssignmentReport + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest} request GetOSPolicyAssignmentReportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|listOSPolicyAssignmentReports}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef ListOSPolicyAssignmentReportsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse} [response] ListOSPolicyAssignmentReportsResponse + */ + + /** + * Calls ListOSPolicyAssignmentReports. + * @function listOSPolicyAssignmentReports + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest} request ListOSPolicyAssignmentReportsRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.ListOSPolicyAssignmentReportsCallback} callback Node-style callback called with the error, if any, and ListOSPolicyAssignmentReportsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.listOSPolicyAssignmentReports = function listOSPolicyAssignmentReports(request, callback) { + return this.rpcCall(listOSPolicyAssignmentReports, $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest, $root.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse, request, callback); + }, "name", { value: "ListOSPolicyAssignmentReports" }); + + /** + * Calls ListOSPolicyAssignmentReports. + * @function listOSPolicyAssignmentReports + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest} request ListOSPolicyAssignmentReportsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|getInventory}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef GetInventoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1alpha.Inventory} [response] Inventory + */ + + /** + * Calls GetInventory. + * @function getInventory + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IGetInventoryRequest} request GetInventoryRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.GetInventoryCallback} callback Node-style callback called with the error, if any, and Inventory + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.getInventory = function getInventory(request, callback) { + return this.rpcCall(getInventory, $root.google.cloud.osconfig.v1alpha.GetInventoryRequest, $root.google.cloud.osconfig.v1alpha.Inventory, request, callback); + }, "name", { value: "GetInventory" }); + + /** + * Calls GetInventory. + * @function getInventory + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IGetInventoryRequest} request GetInventoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|listInventories}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef ListInventoriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1alpha.ListInventoriesResponse} [response] ListInventoriesResponse + */ + + /** + * Calls ListInventories. + * @function listInventories + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IListInventoriesRequest} request ListInventoriesRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.ListInventoriesCallback} callback Node-style callback called with the error, if any, and ListInventoriesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.listInventories = function listInventories(request, callback) { + return this.rpcCall(listInventories, $root.google.cloud.osconfig.v1alpha.ListInventoriesRequest, $root.google.cloud.osconfig.v1alpha.ListInventoriesResponse, request, callback); + }, "name", { value: "ListInventories" }); + + /** + * Calls ListInventories. + * @function listInventories + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IListInventoriesRequest} request ListInventoriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|getVulnerabilityReport}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef GetVulnerabilityReportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport} [response] VulnerabilityReport + */ + + /** + * Calls GetVulnerabilityReport. + * @function getVulnerabilityReport + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest} request GetVulnerabilityReportRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.GetVulnerabilityReportCallback} callback Node-style callback called with the error, if any, and VulnerabilityReport + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.getVulnerabilityReport = function getVulnerabilityReport(request, callback) { + return this.rpcCall(getVulnerabilityReport, $root.google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest, $root.google.cloud.osconfig.v1alpha.VulnerabilityReport, request, callback); + }, "name", { value: "GetVulnerabilityReport" }); + + /** + * Calls GetVulnerabilityReport. + * @function getVulnerabilityReport + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest} request GetVulnerabilityReportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.osconfig.v1alpha.OsConfigZonalService|listVulnerabilityReports}. + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @typedef ListVulnerabilityReportsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse} [response] ListVulnerabilityReportsResponse + */ + + /** + * Calls ListVulnerabilityReports. + * @function listVulnerabilityReports + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest} request ListVulnerabilityReportsRequest message or plain object + * @param {google.cloud.osconfig.v1alpha.OsConfigZonalService.ListVulnerabilityReportsCallback} callback Node-style callback called with the error, if any, and ListVulnerabilityReportsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsConfigZonalService.prototype.listVulnerabilityReports = function listVulnerabilityReports(request, callback) { + return this.rpcCall(listVulnerabilityReports, $root.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest, $root.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse, request, callback); + }, "name", { value: "ListVulnerabilityReports" }); + + /** + * Calls ListVulnerabilityReports. + * @function listVulnerabilityReports + * @memberof google.cloud.osconfig.v1alpha.OsConfigZonalService + * @instance + * @param {google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest} request ListVulnerabilityReportsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return OsConfigZonalService; + })(); + + v1alpha.VulnerabilityReport = (function() { + + /** + * Properties of a VulnerabilityReport. + * @memberof google.cloud.osconfig.v1alpha + * @interface IVulnerabilityReport + * @property {string|null} [name] VulnerabilityReport name + * @property {Array.|null} [vulnerabilities] VulnerabilityReport vulnerabilities + * @property {google.protobuf.ITimestamp|null} [updateTime] VulnerabilityReport updateTime + */ + + /** + * Constructs a new VulnerabilityReport. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a VulnerabilityReport. + * @implements IVulnerabilityReport + * @constructor + * @param {google.cloud.osconfig.v1alpha.IVulnerabilityReport=} [properties] Properties to set + */ + function VulnerabilityReport(properties) { + this.vulnerabilities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VulnerabilityReport name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @instance + */ + VulnerabilityReport.prototype.name = ""; + + /** + * VulnerabilityReport vulnerabilities. + * @member {Array.} vulnerabilities + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @instance + */ + VulnerabilityReport.prototype.vulnerabilities = $util.emptyArray; + + /** + * VulnerabilityReport updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @instance + */ + VulnerabilityReport.prototype.updateTime = null; + + /** + * Creates a new VulnerabilityReport instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @static + * @param {google.cloud.osconfig.v1alpha.IVulnerabilityReport=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport} VulnerabilityReport instance + */ + VulnerabilityReport.create = function create(properties) { + return new VulnerabilityReport(properties); + }; + + /** + * Encodes the specified VulnerabilityReport message. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @static + * @param {google.cloud.osconfig.v1alpha.IVulnerabilityReport} message VulnerabilityReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerabilityReport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.vulnerabilities != null && message.vulnerabilities.length) + for (var i = 0; i < message.vulnerabilities.length; ++i) + $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.encode(message.vulnerabilities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VulnerabilityReport message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @static + * @param {google.cloud.osconfig.v1alpha.IVulnerabilityReport} message VulnerabilityReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerabilityReport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VulnerabilityReport message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport} VulnerabilityReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerabilityReport.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.VulnerabilityReport(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.vulnerabilities && message.vulnerabilities.length)) + message.vulnerabilities = []; + message.vulnerabilities.push($root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.decode(reader, reader.uint32())); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VulnerabilityReport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport} VulnerabilityReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerabilityReport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VulnerabilityReport message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VulnerabilityReport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.vulnerabilities != null && message.hasOwnProperty("vulnerabilities")) { + if (!Array.isArray(message.vulnerabilities)) + return "vulnerabilities: array expected"; + for (var i = 0; i < message.vulnerabilities.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.verify(message.vulnerabilities[i]); + if (error) + return "vulnerabilities." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a VulnerabilityReport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport} VulnerabilityReport + */ + VulnerabilityReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.VulnerabilityReport) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.VulnerabilityReport(); + if (object.name != null) + message.name = String(object.name); + if (object.vulnerabilities) { + if (!Array.isArray(object.vulnerabilities)) + throw TypeError(".google.cloud.osconfig.v1alpha.VulnerabilityReport.vulnerabilities: array expected"); + message.vulnerabilities = []; + for (var i = 0; i < object.vulnerabilities.length; ++i) { + if (typeof object.vulnerabilities[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.VulnerabilityReport.vulnerabilities: object expected"); + message.vulnerabilities[i] = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.fromObject(object.vulnerabilities[i]); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.VulnerabilityReport.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a VulnerabilityReport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport} message VulnerabilityReport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VulnerabilityReport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vulnerabilities = []; + if (options.defaults) { + object.name = ""; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.vulnerabilities && message.vulnerabilities.length) { + object.vulnerabilities = []; + for (var j = 0; j < message.vulnerabilities.length; ++j) + object.vulnerabilities[j] = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.toObject(message.vulnerabilities[j], options); + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this VulnerabilityReport to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @instance + * @returns {Object.} JSON object + */ + VulnerabilityReport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VulnerabilityReport + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VulnerabilityReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.VulnerabilityReport"; + }; + + VulnerabilityReport.Vulnerability = (function() { + + /** + * Properties of a Vulnerability. + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @interface IVulnerability + * @property {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IDetails|null} [details] Vulnerability details + * @property {Array.|null} [installedInventoryItemIds] Vulnerability installedInventoryItemIds + * @property {Array.|null} [availableInventoryItemIds] Vulnerability availableInventoryItemIds + * @property {google.protobuf.ITimestamp|null} [createTime] Vulnerability createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Vulnerability updateTime + * @property {Array.|null} [items] Vulnerability items + */ + + /** + * Constructs a new Vulnerability. + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport + * @classdesc Represents a Vulnerability. + * @implements IVulnerability + * @constructor + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.IVulnerability=} [properties] Properties to set + */ + function Vulnerability(properties) { + this.installedInventoryItemIds = []; + this.availableInventoryItemIds = []; + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Vulnerability details. + * @member {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IDetails|null|undefined} details + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @instance + */ + Vulnerability.prototype.details = null; + + /** + * Vulnerability installedInventoryItemIds. + * @member {Array.} installedInventoryItemIds + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @instance + */ + Vulnerability.prototype.installedInventoryItemIds = $util.emptyArray; + + /** + * Vulnerability availableInventoryItemIds. + * @member {Array.} availableInventoryItemIds + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @instance + */ + Vulnerability.prototype.availableInventoryItemIds = $util.emptyArray; + + /** + * Vulnerability createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @instance + */ + Vulnerability.prototype.createTime = null; + + /** + * Vulnerability updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @instance + */ + Vulnerability.prototype.updateTime = null; + + /** + * Vulnerability items. + * @member {Array.} items + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @instance + */ + Vulnerability.prototype.items = $util.emptyArray; + + /** + * Creates a new Vulnerability instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.IVulnerability=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability} Vulnerability instance + */ + Vulnerability.create = function create(properties) { + return new Vulnerability(properties); + }; + + /** + * Encodes the specified Vulnerability message. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.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.details != null && Object.hasOwnProperty.call(message, "details")) + $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.encode(message.details, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.installedInventoryItemIds != null && message.installedInventoryItemIds.length) + for (var i = 0; i < message.installedInventoryItemIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.installedInventoryItemIds[i]); + if (message.availableInventoryItemIds != null && message.availableInventoryItemIds.length) + for (var i = 0; i < message.availableInventoryItemIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.availableInventoryItemIds[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item.encode(message.items[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Vulnerability message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.details = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.installedInventoryItemIds && message.installedInventoryItemIds.length)) + message.installedInventoryItemIds = []; + message.installedInventoryItemIds.push(reader.string()); + break; + } + case 3: { + if (!(message.availableInventoryItemIds && message.availableInventoryItemIds.length)) + message.availableInventoryItemIds = []; + message.availableInventoryItemIds.push(reader.string()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.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.osconfig.v1alpha.VulnerabilityReport.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.details != null && message.hasOwnProperty("details")) { + var error = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.verify(message.details); + if (error) + return "details." + error; + } + if (message.installedInventoryItemIds != null && message.hasOwnProperty("installedInventoryItemIds")) { + if (!Array.isArray(message.installedInventoryItemIds)) + return "installedInventoryItemIds: array expected"; + for (var i = 0; i < message.installedInventoryItemIds.length; ++i) + if (!$util.isString(message.installedInventoryItemIds[i])) + return "installedInventoryItemIds: string[] expected"; + } + if (message.availableInventoryItemIds != null && message.hasOwnProperty("availableInventoryItemIds")) { + if (!Array.isArray(message.availableInventoryItemIds)) + return "availableInventoryItemIds: array expected"; + for (var i = 0; i < message.availableInventoryItemIds.length; ++i) + if (!$util.isString(message.availableInventoryItemIds[i])) + return "availableInventoryItemIds: 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.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates a Vulnerability message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability} Vulnerability + */ + Vulnerability.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability(); + if (object.details != null) { + if (typeof object.details !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.details: object expected"); + message.details = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.fromObject(object.details); + } + if (object.installedInventoryItemIds) { + if (!Array.isArray(object.installedInventoryItemIds)) + throw TypeError(".google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.installedInventoryItemIds: array expected"); + message.installedInventoryItemIds = []; + for (var i = 0; i < object.installedInventoryItemIds.length; ++i) + message.installedInventoryItemIds[i] = String(object.installedInventoryItemIds[i]); + } + if (object.availableInventoryItemIds) { + if (!Array.isArray(object.availableInventoryItemIds)) + throw TypeError(".google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.availableInventoryItemIds: array expected"); + message.availableInventoryItemIds = []; + for (var i = 0; i < object.availableInventoryItemIds.length; ++i) + message.availableInventoryItemIds[i] = String(object.availableInventoryItemIds[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.items: object expected"); + message.items[i] = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Vulnerability message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.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.arrays || options.defaults) { + object.installedInventoryItemIds = []; + object.availableInventoryItemIds = []; + object.items = []; + } + if (options.defaults) { + object.details = null; + object.createTime = null; + object.updateTime = null; + } + if (message.details != null && message.hasOwnProperty("details")) + object.details = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.toObject(message.details, options); + if (message.installedInventoryItemIds && message.installedInventoryItemIds.length) { + object.installedInventoryItemIds = []; + for (var j = 0; j < message.installedInventoryItemIds.length; ++j) + object.installedInventoryItemIds[j] = message.installedInventoryItemIds[j]; + } + if (message.availableInventoryItemIds && message.availableInventoryItemIds.length) { + object.availableInventoryItemIds = []; + for (var j = 0; j < message.availableInventoryItemIds.length; ++j) + object.availableInventoryItemIds[j] = message.availableInventoryItemIds[j]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this Vulnerability to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.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.osconfig.v1alpha.VulnerabilityReport.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability"; + }; + + Vulnerability.Details = (function() { + + /** + * Properties of a Details. + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @interface IDetails + * @property {string|null} [cve] Details cve + * @property {number|null} [cvssV2Score] Details cvssV2Score + * @property {google.cloud.osconfig.v1alpha.ICVSSv3|null} [cvssV3] Details cvssV3 + * @property {string|null} [severity] Details severity + * @property {string|null} [description] Details description + * @property {Array.|null} [references] Details references + */ + + /** + * Constructs a new Details. + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @classdesc Represents a Details. + * @implements IDetails + * @constructor + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IDetails=} [properties] Properties to set + */ + function Details(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]]; + } + + /** + * Details cve. + * @member {string} cve + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @instance + */ + Details.prototype.cve = ""; + + /** + * Details cvssV2Score. + * @member {number} cvssV2Score + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @instance + */ + Details.prototype.cvssV2Score = 0; + + /** + * Details cvssV3. + * @member {google.cloud.osconfig.v1alpha.ICVSSv3|null|undefined} cvssV3 + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @instance + */ + Details.prototype.cvssV3 = null; + + /** + * Details severity. + * @member {string} severity + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @instance + */ + Details.prototype.severity = ""; + + /** + * Details description. + * @member {string} description + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @instance + */ + Details.prototype.description = ""; + + /** + * Details references. + * @member {Array.} references + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @instance + */ + Details.prototype.references = $util.emptyArray; + + /** + * Creates a new Details instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IDetails=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details} Details instance + */ + Details.create = function create(properties) { + return new Details(properties); + }; + + /** + * Encodes the specified Details message. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IDetails} message Details message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Details.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cve != null && Object.hasOwnProperty.call(message, "cve")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cve); + if (message.cvssV2Score != null && Object.hasOwnProperty.call(message, "cvssV2Score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.cvssV2Score); + if (message.cvssV3 != null && Object.hasOwnProperty.call(message, "cvssV3")) + $root.google.cloud.osconfig.v1alpha.CVSSv3.encode(message.cvssV3, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.severity); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.references != null && message.references.length) + for (var i = 0; i < message.references.length; ++i) + $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference.encode(message.references[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Details message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IDetails} message Details message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Details.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Details message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details} Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Details.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cve = reader.string(); + break; + } + case 2: { + message.cvssV2Score = reader.float(); + break; + } + case 3: { + message.cvssV3 = $root.google.cloud.osconfig.v1alpha.CVSSv3.decode(reader, reader.uint32()); + break; + } + case 4: { + message.severity = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + if (!(message.references && message.references.length)) + message.references = []; + message.references.push($root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Details message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details} Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Details.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Details message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Details.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cve != null && message.hasOwnProperty("cve")) + if (!$util.isString(message.cve)) + return "cve: string expected"; + if (message.cvssV2Score != null && message.hasOwnProperty("cvssV2Score")) + if (typeof message.cvssV2Score !== "number") + return "cvssV2Score: number expected"; + if (message.cvssV3 != null && message.hasOwnProperty("cvssV3")) { + var error = $root.google.cloud.osconfig.v1alpha.CVSSv3.verify(message.cvssV3); + if (error) + return "cvssV3." + error; + } + if (message.severity != null && message.hasOwnProperty("severity")) + if (!$util.isString(message.severity)) + return "severity: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference.verify(message.references[i]); + if (error) + return "references." + error; + } + } + return null; + }; + + /** + * Creates a Details message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details} Details + */ + Details.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details(); + if (object.cve != null) + message.cve = String(object.cve); + if (object.cvssV2Score != null) + message.cvssV2Score = Number(object.cvssV2Score); + if (object.cvssV3 != null) { + if (typeof object.cvssV3 !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.cvssV3: object expected"); + message.cvssV3 = $root.google.cloud.osconfig.v1alpha.CVSSv3.fromObject(object.cvssV3); + } + if (object.severity != null) + message.severity = String(object.severity); + if (object.description != null) + message.description = String(object.description); + if (object.references) { + if (!Array.isArray(object.references)) + throw TypeError(".google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.references: array expected"); + message.references = []; + for (var i = 0; i < object.references.length; ++i) { + if (typeof object.references[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.references: object expected"); + message.references[i] = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference.fromObject(object.references[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Details message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details} message Details + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Details.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.references = []; + if (options.defaults) { + object.cve = ""; + object.cvssV2Score = 0; + object.cvssV3 = null; + object.severity = ""; + object.description = ""; + } + if (message.cve != null && message.hasOwnProperty("cve")) + object.cve = message.cve; + if (message.cvssV2Score != null && message.hasOwnProperty("cvssV2Score")) + object.cvssV2Score = options.json && !isFinite(message.cvssV2Score) ? String(message.cvssV2Score) : message.cvssV2Score; + if (message.cvssV3 != null && message.hasOwnProperty("cvssV3")) + object.cvssV3 = $root.google.cloud.osconfig.v1alpha.CVSSv3.toObject(message.cvssV3, options); + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = message.severity; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.references && message.references.length) { + object.references = []; + for (var j = 0; j < message.references.length; ++j) + object.references[j] = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference.toObject(message.references[j], options); + } + return object; + }; + + /** + * Converts this Details to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @instance + * @returns {Object.} JSON object + */ + Details.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Details + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Details.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details"; + }; + + Details.Reference = (function() { + + /** + * Properties of a Reference. + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @interface IReference + * @property {string|null} [url] Reference url + * @property {string|null} [source] Reference source + */ + + /** + * Constructs a new Reference. + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details + * @classdesc Represents a Reference. + * @implements IReference + * @constructor + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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 url. + * @member {string} url + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference + * @instance + */ + Reference.prototype.url = ""; + + /** + * Reference source. + * @member {string} source + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference + * @instance + */ + Reference.prototype.source = ""; + + /** + * Creates a new Reference instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.IReference=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference} Reference instance + */ + Reference.create = function create(properties) { + return new Reference(properties); + }; + + /** + * Encodes the specified Reference message. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.source); + return writer; + }; + + /** + * Encodes the specified Reference message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.url = reader.string(); + break; + } + case 2: { + message.source = 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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: 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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference} Reference + */ + Reference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference(); + if (object.url != null) + message.url = String(object.url); + if (object.source != null) + message.source = String(object.source); + return message; + }; + + /** + * Creates a plain object from a Reference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.url = ""; + object.source = ""; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + return object; + }; + + /** + * Converts this Reference to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.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.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Details.Reference"; + }; + + return Reference; + })(); + + return Details; + })(); + + Vulnerability.Item = (function() { + + /** + * Properties of an Item. + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @interface IItem + * @property {string|null} [installedInventoryItemId] Item installedInventoryItemId + * @property {string|null} [availableInventoryItemId] Item availableInventoryItemId + * @property {string|null} [fixedCpeUri] Item fixedCpeUri + * @property {string|null} [upstreamFix] Item upstreamFix + */ + + /** + * Constructs a new Item. + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability + * @classdesc Represents an Item. + * @implements IItem + * @constructor + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IItem=} [properties] Properties to set + */ + function Item(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Item installedInventoryItemId. + * @member {string} installedInventoryItemId + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @instance + */ + Item.prototype.installedInventoryItemId = ""; + + /** + * Item availableInventoryItemId. + * @member {string} availableInventoryItemId + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @instance + */ + Item.prototype.availableInventoryItemId = ""; + + /** + * Item fixedCpeUri. + * @member {string} fixedCpeUri + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @instance + */ + Item.prototype.fixedCpeUri = ""; + + /** + * Item upstreamFix. + * @member {string} upstreamFix + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @instance + */ + Item.prototype.upstreamFix = ""; + + /** + * Creates a new Item instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IItem=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item} Item instance + */ + Item.create = function create(properties) { + return new Item(properties); + }; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.installedInventoryItemId != null && Object.hasOwnProperty.call(message, "installedInventoryItemId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.installedInventoryItemId); + if (message.availableInventoryItemId != null && Object.hasOwnProperty.call(message, "availableInventoryItemId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.availableInventoryItemId); + if (message.fixedCpeUri != null && Object.hasOwnProperty.call(message, "fixedCpeUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fixedCpeUri); + if (message.upstreamFix != null && Object.hasOwnProperty.call(message, "upstreamFix")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.upstreamFix); + return writer; + }; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Item message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.installedInventoryItemId = reader.string(); + break; + } + case 2: { + message.availableInventoryItemId = reader.string(); + break; + } + case 3: { + message.fixedCpeUri = reader.string(); + break; + } + case 4: { + message.upstreamFix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Item message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Item.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.installedInventoryItemId != null && message.hasOwnProperty("installedInventoryItemId")) + if (!$util.isString(message.installedInventoryItemId)) + return "installedInventoryItemId: string expected"; + if (message.availableInventoryItemId != null && message.hasOwnProperty("availableInventoryItemId")) + if (!$util.isString(message.availableInventoryItemId)) + return "availableInventoryItemId: string expected"; + if (message.fixedCpeUri != null && message.hasOwnProperty("fixedCpeUri")) + if (!$util.isString(message.fixedCpeUri)) + return "fixedCpeUri: string expected"; + if (message.upstreamFix != null && message.hasOwnProperty("upstreamFix")) + if (!$util.isString(message.upstreamFix)) + return "upstreamFix: string expected"; + return null; + }; + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item} Item + */ + Item.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item(); + if (object.installedInventoryItemId != null) + message.installedInventoryItemId = String(object.installedInventoryItemId); + if (object.availableInventoryItemId != null) + message.availableInventoryItemId = String(object.availableInventoryItemId); + if (object.fixedCpeUri != null) + message.fixedCpeUri = String(object.fixedCpeUri); + if (object.upstreamFix != null) + message.upstreamFix = String(object.upstreamFix); + return message; + }; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @static + * @param {google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item} message Item + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Item.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.installedInventoryItemId = ""; + object.availableInventoryItemId = ""; + object.fixedCpeUri = ""; + object.upstreamFix = ""; + } + if (message.installedInventoryItemId != null && message.hasOwnProperty("installedInventoryItemId")) + object.installedInventoryItemId = message.installedInventoryItemId; + if (message.availableInventoryItemId != null && message.hasOwnProperty("availableInventoryItemId")) + object.availableInventoryItemId = message.availableInventoryItemId; + if (message.fixedCpeUri != null && message.hasOwnProperty("fixedCpeUri")) + object.fixedCpeUri = message.fixedCpeUri; + if (message.upstreamFix != null && message.hasOwnProperty("upstreamFix")) + object.upstreamFix = message.upstreamFix; + return object; + }; + + /** + * Converts this Item to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @instance + * @returns {Object.} JSON object + */ + Item.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Item + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Item.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.VulnerabilityReport.Vulnerability.Item"; + }; + + return Item; + })(); + + return Vulnerability; + })(); + + return VulnerabilityReport; + })(); + + v1alpha.GetVulnerabilityReportRequest = (function() { + + /** + * Properties of a GetVulnerabilityReportRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface IGetVulnerabilityReportRequest + * @property {string|null} [name] GetVulnerabilityReportRequest name + */ + + /** + * Constructs a new GetVulnerabilityReportRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a GetVulnerabilityReportRequest. + * @implements IGetVulnerabilityReportRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest=} [properties] Properties to set + */ + function GetVulnerabilityReportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVulnerabilityReportRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest + * @instance + */ + GetVulnerabilityReportRequest.prototype.name = ""; + + /** + * Creates a new GetVulnerabilityReportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest} GetVulnerabilityReportRequest instance + */ + GetVulnerabilityReportRequest.create = function create(properties) { + return new GetVulnerabilityReportRequest(properties); + }; + + /** + * Encodes the specified GetVulnerabilityReportRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest} message GetVulnerabilityReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVulnerabilityReportRequest.encode = function encode(message, writer) { + 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 GetVulnerabilityReportRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest} message GetVulnerabilityReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVulnerabilityReportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVulnerabilityReportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest} GetVulnerabilityReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVulnerabilityReportRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest(); + 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 GetVulnerabilityReportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest} GetVulnerabilityReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVulnerabilityReportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVulnerabilityReportRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVulnerabilityReportRequest.verify = function verify(message) { + if (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 GetVulnerabilityReportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest} GetVulnerabilityReportRequest + */ + GetVulnerabilityReportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetVulnerabilityReportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest + * @static + * @param {google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest} message GetVulnerabilityReportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVulnerabilityReportRequest.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 GetVulnerabilityReportRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest + * @instance + * @returns {Object.} JSON object + */ + GetVulnerabilityReportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetVulnerabilityReportRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetVulnerabilityReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest"; + }; + + return GetVulnerabilityReportRequest; + })(); + + v1alpha.ListVulnerabilityReportsRequest = (function() { + + /** + * Properties of a ListVulnerabilityReportsRequest. + * @memberof google.cloud.osconfig.v1alpha + * @interface IListVulnerabilityReportsRequest + * @property {string|null} [parent] ListVulnerabilityReportsRequest parent + * @property {number|null} [pageSize] ListVulnerabilityReportsRequest pageSize + * @property {string|null} [pageToken] ListVulnerabilityReportsRequest pageToken + * @property {string|null} [filter] ListVulnerabilityReportsRequest filter + */ + + /** + * Constructs a new ListVulnerabilityReportsRequest. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a ListVulnerabilityReportsRequest. + * @implements IListVulnerabilityReportsRequest + * @constructor + * @param {google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest=} [properties] Properties to set + */ + function ListVulnerabilityReportsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVulnerabilityReportsRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @instance + */ + ListVulnerabilityReportsRequest.prototype.parent = ""; + + /** + * ListVulnerabilityReportsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @instance + */ + ListVulnerabilityReportsRequest.prototype.pageSize = 0; + + /** + * ListVulnerabilityReportsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @instance + */ + ListVulnerabilityReportsRequest.prototype.pageToken = ""; + + /** + * ListVulnerabilityReportsRequest filter. + * @member {string} filter + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @instance + */ + ListVulnerabilityReportsRequest.prototype.filter = ""; + + /** + * Creates a new ListVulnerabilityReportsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest} ListVulnerabilityReportsRequest instance + */ + ListVulnerabilityReportsRequest.create = function create(properties) { + return new ListVulnerabilityReportsRequest(properties); + }; + + /** + * Encodes the specified ListVulnerabilityReportsRequest message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest} message ListVulnerabilityReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVulnerabilityReportsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListVulnerabilityReportsRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest} message ListVulnerabilityReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVulnerabilityReportsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVulnerabilityReportsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest} ListVulnerabilityReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVulnerabilityReportsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVulnerabilityReportsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest} ListVulnerabilityReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVulnerabilityReportsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVulnerabilityReportsRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVulnerabilityReportsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListVulnerabilityReportsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest} ListVulnerabilityReportsRequest + */ + ListVulnerabilityReportsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListVulnerabilityReportsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @static + * @param {google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest} message ListVulnerabilityReportsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVulnerabilityReportsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListVulnerabilityReportsRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @instance + * @returns {Object.} JSON object + */ + ListVulnerabilityReportsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVulnerabilityReportsRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVulnerabilityReportsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest"; + }; + + return ListVulnerabilityReportsRequest; + })(); + + v1alpha.ListVulnerabilityReportsResponse = (function() { + + /** + * Properties of a ListVulnerabilityReportsResponse. + * @memberof google.cloud.osconfig.v1alpha + * @interface IListVulnerabilityReportsResponse + * @property {Array.|null} [vulnerabilityReports] ListVulnerabilityReportsResponse vulnerabilityReports + * @property {string|null} [nextPageToken] ListVulnerabilityReportsResponse nextPageToken + */ + + /** + * Constructs a new ListVulnerabilityReportsResponse. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a ListVulnerabilityReportsResponse. + * @implements IListVulnerabilityReportsResponse + * @constructor + * @param {google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse=} [properties] Properties to set + */ + function ListVulnerabilityReportsResponse(properties) { + this.vulnerabilityReports = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVulnerabilityReportsResponse vulnerabilityReports. + * @member {Array.} vulnerabilityReports + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse + * @instance + */ + ListVulnerabilityReportsResponse.prototype.vulnerabilityReports = $util.emptyArray; + + /** + * ListVulnerabilityReportsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse + * @instance + */ + ListVulnerabilityReportsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListVulnerabilityReportsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse} ListVulnerabilityReportsResponse instance + */ + ListVulnerabilityReportsResponse.create = function create(properties) { + return new ListVulnerabilityReportsResponse(properties); + }; + + /** + * Encodes the specified ListVulnerabilityReportsResponse message. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse} message ListVulnerabilityReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVulnerabilityReportsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vulnerabilityReports != null && message.vulnerabilityReports.length) + for (var i = 0; i < message.vulnerabilityReports.length; ++i) + $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.encode(message.vulnerabilityReports[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 ListVulnerabilityReportsResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse} message ListVulnerabilityReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVulnerabilityReportsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVulnerabilityReportsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse} ListVulnerabilityReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVulnerabilityReportsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.vulnerabilityReports && message.vulnerabilityReports.length)) + message.vulnerabilityReports = []; + message.vulnerabilityReports.push($root.google.cloud.osconfig.v1alpha.VulnerabilityReport.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVulnerabilityReportsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse} ListVulnerabilityReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVulnerabilityReportsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVulnerabilityReportsResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVulnerabilityReportsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vulnerabilityReports != null && message.hasOwnProperty("vulnerabilityReports")) { + if (!Array.isArray(message.vulnerabilityReports)) + return "vulnerabilityReports: array expected"; + for (var i = 0; i < message.vulnerabilityReports.length; ++i) { + var error = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.verify(message.vulnerabilityReports[i]); + if (error) + return "vulnerabilityReports." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListVulnerabilityReportsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse} ListVulnerabilityReportsResponse + */ + ListVulnerabilityReportsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse(); + if (object.vulnerabilityReports) { + if (!Array.isArray(object.vulnerabilityReports)) + throw TypeError(".google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse.vulnerabilityReports: array expected"); + message.vulnerabilityReports = []; + for (var i = 0; i < object.vulnerabilityReports.length; ++i) { + if (typeof object.vulnerabilityReports[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse.vulnerabilityReports: object expected"); + message.vulnerabilityReports[i] = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.fromObject(object.vulnerabilityReports[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListVulnerabilityReportsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse + * @static + * @param {google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse} message ListVulnerabilityReportsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVulnerabilityReportsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vulnerabilityReports = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.vulnerabilityReports && message.vulnerabilityReports.length) { + object.vulnerabilityReports = []; + for (var j = 0; j < message.vulnerabilityReports.length; ++j) + object.vulnerabilityReports[j] = $root.google.cloud.osconfig.v1alpha.VulnerabilityReport.toObject(message.vulnerabilityReports[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListVulnerabilityReportsResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse + * @instance + * @returns {Object.} JSON object + */ + ListVulnerabilityReportsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVulnerabilityReportsResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVulnerabilityReportsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse"; + }; + + return ListVulnerabilityReportsResponse; + })(); + + v1alpha.CVSSv3 = (function() { + + /** + * Properties of a CVSSv3. + * @memberof google.cloud.osconfig.v1alpha + * @interface ICVSSv3 + * @property {number|null} [baseScore] CVSSv3 baseScore + * @property {number|null} [exploitabilityScore] CVSSv3 exploitabilityScore + * @property {number|null} [impactScore] CVSSv3 impactScore + * @property {google.cloud.osconfig.v1alpha.CVSSv3.AttackVector|null} [attackVector] CVSSv3 attackVector + * @property {google.cloud.osconfig.v1alpha.CVSSv3.AttackComplexity|null} [attackComplexity] CVSSv3 attackComplexity + * @property {google.cloud.osconfig.v1alpha.CVSSv3.PrivilegesRequired|null} [privilegesRequired] CVSSv3 privilegesRequired + * @property {google.cloud.osconfig.v1alpha.CVSSv3.UserInteraction|null} [userInteraction] CVSSv3 userInteraction + * @property {google.cloud.osconfig.v1alpha.CVSSv3.Scope|null} [scope] CVSSv3 scope + * @property {google.cloud.osconfig.v1alpha.CVSSv3.Impact|null} [confidentialityImpact] CVSSv3 confidentialityImpact + * @property {google.cloud.osconfig.v1alpha.CVSSv3.Impact|null} [integrityImpact] CVSSv3 integrityImpact + * @property {google.cloud.osconfig.v1alpha.CVSSv3.Impact|null} [availabilityImpact] CVSSv3 availabilityImpact + */ + + /** + * Constructs a new CVSSv3. + * @memberof google.cloud.osconfig.v1alpha + * @classdesc Represents a CVSSv3. + * @implements ICVSSv3 + * @constructor + * @param {google.cloud.osconfig.v1alpha.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.osconfig.v1alpha.CVSSv3 + * @instance + */ + CVSSv3.prototype.baseScore = 0; + + /** + * CVSSv3 exploitabilityScore. + * @member {number} exploitabilityScore + * @memberof google.cloud.osconfig.v1alpha.CVSSv3 + * @instance + */ + CVSSv3.prototype.exploitabilityScore = 0; + + /** + * CVSSv3 impactScore. + * @member {number} impactScore + * @memberof google.cloud.osconfig.v1alpha.CVSSv3 + * @instance + */ + CVSSv3.prototype.impactScore = 0; + + /** + * CVSSv3 attackVector. + * @member {google.cloud.osconfig.v1alpha.CVSSv3.AttackVector} attackVector + * @memberof google.cloud.osconfig.v1alpha.CVSSv3 + * @instance + */ + CVSSv3.prototype.attackVector = 0; + + /** + * CVSSv3 attackComplexity. + * @member {google.cloud.osconfig.v1alpha.CVSSv3.AttackComplexity} attackComplexity + * @memberof google.cloud.osconfig.v1alpha.CVSSv3 + * @instance + */ + CVSSv3.prototype.attackComplexity = 0; + + /** + * CVSSv3 privilegesRequired. + * @member {google.cloud.osconfig.v1alpha.CVSSv3.PrivilegesRequired} privilegesRequired + * @memberof google.cloud.osconfig.v1alpha.CVSSv3 + * @instance + */ + CVSSv3.prototype.privilegesRequired = 0; + + /** + * CVSSv3 userInteraction. + * @member {google.cloud.osconfig.v1alpha.CVSSv3.UserInteraction} userInteraction + * @memberof google.cloud.osconfig.v1alpha.CVSSv3 + * @instance + */ + CVSSv3.prototype.userInteraction = 0; + + /** + * CVSSv3 scope. + * @member {google.cloud.osconfig.v1alpha.CVSSv3.Scope} scope + * @memberof google.cloud.osconfig.v1alpha.CVSSv3 + * @instance + */ + CVSSv3.prototype.scope = 0; + + /** + * CVSSv3 confidentialityImpact. + * @member {google.cloud.osconfig.v1alpha.CVSSv3.Impact} confidentialityImpact + * @memberof google.cloud.osconfig.v1alpha.CVSSv3 + * @instance + */ + CVSSv3.prototype.confidentialityImpact = 0; + + /** + * CVSSv3 integrityImpact. + * @member {google.cloud.osconfig.v1alpha.CVSSv3.Impact} integrityImpact + * @memberof google.cloud.osconfig.v1alpha.CVSSv3 + * @instance + */ + CVSSv3.prototype.integrityImpact = 0; + + /** + * CVSSv3 availabilityImpact. + * @member {google.cloud.osconfig.v1alpha.CVSSv3.Impact} availabilityImpact + * @memberof google.cloud.osconfig.v1alpha.CVSSv3 + * @instance + */ + CVSSv3.prototype.availabilityImpact = 0; + + /** + * Creates a new CVSSv3 instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1alpha.CVSSv3 + * @static + * @param {google.cloud.osconfig.v1alpha.ICVSSv3=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1alpha.CVSSv3} CVSSv3 instance + */ + CVSSv3.create = function create(properties) { + return new CVSSv3(properties); + }; + + /** + * Encodes the specified CVSSv3 message. Does not implicitly {@link google.cloud.osconfig.v1alpha.CVSSv3.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1alpha.CVSSv3 + * @static + * @param {google.cloud.osconfig.v1alpha.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 5 =*/13).float(message.baseScore); + if (message.exploitabilityScore != null && Object.hasOwnProperty.call(message, "exploitabilityScore")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.exploitabilityScore); + if (message.impactScore != null && Object.hasOwnProperty.call(message, "impactScore")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.impactScore); + 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.osconfig.v1alpha.CVSSv3.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1alpha.CVSSv3 + * @static + * @param {google.cloud.osconfig.v1alpha.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.osconfig.v1alpha.CVSSv3 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1alpha.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.osconfig.v1alpha.CVSSv3(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseScore = reader.float(); + break; + } + case 2: { + message.exploitabilityScore = reader.float(); + break; + } + case 3: { + message.impactScore = reader.float(); + 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.osconfig.v1alpha.CVSSv3 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1alpha.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.osconfig.v1alpha.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.exploitabilityScore != null && message.hasOwnProperty("exploitabilityScore")) + if (typeof message.exploitabilityScore !== "number") + return "exploitabilityScore: number expected"; + if (message.impactScore != null && message.hasOwnProperty("impactScore")) + if (typeof message.impactScore !== "number") + return "impactScore: 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.osconfig.v1alpha.CVSSv3 + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1alpha.CVSSv3} CVSSv3 + */ + CVSSv3.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1alpha.CVSSv3) + return object; + var message = new $root.google.cloud.osconfig.v1alpha.CVSSv3(); + if (object.baseScore != null) + message.baseScore = Number(object.baseScore); + if (object.exploitabilityScore != null) + message.exploitabilityScore = Number(object.exploitabilityScore); + if (object.impactScore != null) + message.impactScore = Number(object.impactScore); + 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.osconfig.v1alpha.CVSSv3 + * @static + * @param {google.cloud.osconfig.v1alpha.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.exploitabilityScore = 0; + object.impactScore = 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.exploitabilityScore != null && message.hasOwnProperty("exploitabilityScore")) + object.exploitabilityScore = options.json && !isFinite(message.exploitabilityScore) ? String(message.exploitabilityScore) : message.exploitabilityScore; + if (message.impactScore != null && message.hasOwnProperty("impactScore")) + object.impactScore = options.json && !isFinite(message.impactScore) ? String(message.impactScore) : message.impactScore; + if (message.attackVector != null && message.hasOwnProperty("attackVector")) + object.attackVector = options.enums === String ? $root.google.cloud.osconfig.v1alpha.CVSSv3.AttackVector[message.attackVector] === undefined ? message.attackVector : $root.google.cloud.osconfig.v1alpha.CVSSv3.AttackVector[message.attackVector] : message.attackVector; + if (message.attackComplexity != null && message.hasOwnProperty("attackComplexity")) + object.attackComplexity = options.enums === String ? $root.google.cloud.osconfig.v1alpha.CVSSv3.AttackComplexity[message.attackComplexity] === undefined ? message.attackComplexity : $root.google.cloud.osconfig.v1alpha.CVSSv3.AttackComplexity[message.attackComplexity] : message.attackComplexity; + if (message.privilegesRequired != null && message.hasOwnProperty("privilegesRequired")) + object.privilegesRequired = options.enums === String ? $root.google.cloud.osconfig.v1alpha.CVSSv3.PrivilegesRequired[message.privilegesRequired] === undefined ? message.privilegesRequired : $root.google.cloud.osconfig.v1alpha.CVSSv3.PrivilegesRequired[message.privilegesRequired] : message.privilegesRequired; + if (message.userInteraction != null && message.hasOwnProperty("userInteraction")) + object.userInteraction = options.enums === String ? $root.google.cloud.osconfig.v1alpha.CVSSv3.UserInteraction[message.userInteraction] === undefined ? message.userInteraction : $root.google.cloud.osconfig.v1alpha.CVSSv3.UserInteraction[message.userInteraction] : message.userInteraction; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.osconfig.v1alpha.CVSSv3.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.osconfig.v1alpha.CVSSv3.Scope[message.scope] : message.scope; + if (message.confidentialityImpact != null && message.hasOwnProperty("confidentialityImpact")) + object.confidentialityImpact = options.enums === String ? $root.google.cloud.osconfig.v1alpha.CVSSv3.Impact[message.confidentialityImpact] === undefined ? message.confidentialityImpact : $root.google.cloud.osconfig.v1alpha.CVSSv3.Impact[message.confidentialityImpact] : message.confidentialityImpact; + if (message.integrityImpact != null && message.hasOwnProperty("integrityImpact")) + object.integrityImpact = options.enums === String ? $root.google.cloud.osconfig.v1alpha.CVSSv3.Impact[message.integrityImpact] === undefined ? message.integrityImpact : $root.google.cloud.osconfig.v1alpha.CVSSv3.Impact[message.integrityImpact] : message.integrityImpact; + if (message.availabilityImpact != null && message.hasOwnProperty("availabilityImpact")) + object.availabilityImpact = options.enums === String ? $root.google.cloud.osconfig.v1alpha.CVSSv3.Impact[message.availabilityImpact] === undefined ? message.availabilityImpact : $root.google.cloud.osconfig.v1alpha.CVSSv3.Impact[message.availabilityImpact] : message.availabilityImpact; + return object; + }; + + /** + * Converts this CVSSv3 to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1alpha.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.osconfig.v1alpha.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.osconfig.v1alpha.CVSSv3"; + }; + + /** + * AttackVector enum. + * @name google.cloud.osconfig.v1alpha.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.osconfig.v1alpha.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.osconfig.v1alpha.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.osconfig.v1alpha.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.osconfig.v1alpha.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.osconfig.v1alpha.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; + })(); + + return v1alpha; + })(); + + return osconfig; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @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.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $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.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 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + 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.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.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.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.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.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.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.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.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + return protobuf; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + + return Date; + })(); + + type.DateTime = (function() { + + /** + * Properties of a DateTime. + * @memberof google.type + * @interface IDateTime + * @property {number|null} [year] DateTime year + * @property {number|null} [month] DateTime month + * @property {number|null} [day] DateTime day + * @property {number|null} [hours] DateTime hours + * @property {number|null} [minutes] DateTime minutes + * @property {number|null} [seconds] DateTime seconds + * @property {number|null} [nanos] DateTime nanos + * @property {google.protobuf.IDuration|null} [utcOffset] DateTime utcOffset + * @property {google.type.ITimeZone|null} [timeZone] DateTime timeZone + */ + + /** + * Constructs a new DateTime. + * @memberof google.type + * @classdesc Represents a DateTime. + * @implements IDateTime + * @constructor + * @param {google.type.IDateTime=} [properties] Properties to set + */ + function DateTime(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DateTime year. + * @member {number} year + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.year = 0; + + /** + * DateTime month. + * @member {number} month + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.month = 0; + + /** + * DateTime day. + * @member {number} day + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.day = 0; + + /** + * DateTime hours. + * @member {number} hours + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.hours = 0; + + /** + * DateTime minutes. + * @member {number} minutes + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.minutes = 0; + + /** + * DateTime seconds. + * @member {number} seconds + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.seconds = 0; + + /** + * DateTime nanos. + * @member {number} nanos + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.nanos = 0; + + /** + * DateTime utcOffset. + * @member {google.protobuf.IDuration|null|undefined} utcOffset + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.utcOffset = null; + + /** + * DateTime timeZone. + * @member {google.type.ITimeZone|null|undefined} timeZone + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.timeZone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DateTime timeOffset. + * @member {"utcOffset"|"timeZone"|undefined} timeOffset + * @memberof google.type.DateTime + * @instance + */ + Object.defineProperty(DateTime.prototype, "timeOffset", { + get: $util.oneOfGetter($oneOfFields = ["utcOffset", "timeZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DateTime instance using the specified properties. + * @function create + * @memberof google.type.DateTime + * @static + * @param {google.type.IDateTime=} [properties] Properties to set + * @returns {google.type.DateTime} DateTime instance + */ + DateTime.create = function create(properties) { + return new DateTime(properties); + }; + + /** + * Encodes the specified DateTime message. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @function encode + * @memberof google.type.DateTime + * @static + * @param {google.type.IDateTime} message DateTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.hours); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.minutes); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.nanos); + if (message.utcOffset != null && Object.hasOwnProperty.call(message, "utcOffset")) + $root.google.protobuf.Duration.encode(message.utcOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + $root.google.type.TimeZone.encode(message.timeZone, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.DateTime + * @static + * @param {google.type.IDateTime} message DateTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateTime message from the specified reader or buffer. + * @function decode + * @memberof google.type.DateTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.DateTime} DateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTime.decode = function 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.DateTime(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + case 4: { + message.hours = reader.int32(); + break; + } + case 5: { + message.minutes = reader.int32(); + break; + } + case 6: { + message.seconds = reader.int32(); + break; + } + case 7: { + message.nanos = reader.int32(); + break; + } + case 8: { + message.utcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.timeZone = $root.google.type.TimeZone.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DateTime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.DateTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.DateTime} DateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateTime message. + * @function verify + * @memberof google.type.DateTime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateTime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + if (message.hours != null && message.hasOwnProperty("hours")) + if (!$util.isInteger(message.hours)) + return "hours: integer expected"; + if (message.minutes != null && message.hasOwnProperty("minutes")) + if (!$util.isInteger(message.minutes)) + return "minutes: integer expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + properties.timeOffset = 1; + { + var error = $root.google.protobuf.Duration.verify(message.utcOffset); + if (error) + return "utcOffset." + error; + } + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + if (properties.timeOffset === 1) + return "timeOffset: multiple values"; + properties.timeOffset = 1; + { + var error = $root.google.type.TimeZone.verify(message.timeZone); + if (error) + return "timeZone." + error; + } + } + return null; + }; + + /** + * Creates a DateTime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.DateTime + * @static + * @param {Object.} object Plain object + * @returns {google.type.DateTime} DateTime + */ + DateTime.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.DateTime) + return object; + var message = new $root.google.type.DateTime(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + if (object.hours != null) + message.hours = object.hours | 0; + if (object.minutes != null) + message.minutes = object.minutes | 0; + if (object.seconds != null) + message.seconds = object.seconds | 0; + if (object.nanos != null) + message.nanos = object.nanos | 0; + if (object.utcOffset != null) { + if (typeof object.utcOffset !== "object") + throw TypeError(".google.type.DateTime.utcOffset: object expected"); + message.utcOffset = $root.google.protobuf.Duration.fromObject(object.utcOffset); + } + if (object.timeZone != null) { + if (typeof object.timeZone !== "object") + throw TypeError(".google.type.DateTime.timeZone: object expected"); + message.timeZone = $root.google.type.TimeZone.fromObject(object.timeZone); + } + return message; + }; + + /** + * Creates a plain object from a DateTime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.DateTime + * @static + * @param {google.type.DateTime} message DateTime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateTime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + object.hours = 0; + object.minutes = 0; + object.seconds = 0; + object.nanos = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + if (message.hours != null && message.hasOwnProperty("hours")) + object.hours = message.hours; + if (message.minutes != null && message.hasOwnProperty("minutes")) + object.minutes = message.minutes; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + object.utcOffset = $root.google.protobuf.Duration.toObject(message.utcOffset, options); + if (options.oneofs) + object.timeOffset = "utcOffset"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + object.timeZone = $root.google.type.TimeZone.toObject(message.timeZone, options); + if (options.oneofs) + object.timeOffset = "timeZone"; + } + return object; + }; + + /** + * Converts this DateTime to JSON. + * @function toJSON + * @memberof google.type.DateTime + * @instance + * @returns {Object.} JSON object + */ + DateTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateTime + * @function getTypeUrl + * @memberof google.type.DateTime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.DateTime"; + }; + + return DateTime; + })(); + + type.TimeZone = (function() { + + /** + * Properties of a TimeZone. + * @memberof google.type + * @interface ITimeZone + * @property {string|null} [id] TimeZone id + * @property {string|null} [version] TimeZone version + */ + + /** + * Constructs a new TimeZone. + * @memberof google.type + * @classdesc Represents a TimeZone. + * @implements ITimeZone + * @constructor + * @param {google.type.ITimeZone=} [properties] Properties to set + */ + function TimeZone(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeZone id. + * @member {string} id + * @memberof google.type.TimeZone + * @instance + */ + TimeZone.prototype.id = ""; + + /** + * TimeZone version. + * @member {string} version + * @memberof google.type.TimeZone + * @instance + */ + TimeZone.prototype.version = ""; + + /** + * Creates a new TimeZone instance using the specified properties. + * @function create + * @memberof google.type.TimeZone + * @static + * @param {google.type.ITimeZone=} [properties] Properties to set + * @returns {google.type.TimeZone} TimeZone instance + */ + TimeZone.create = function create(properties) { + return new TimeZone(properties); + }; + + /** + * Encodes the specified TimeZone message. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @function encode + * @memberof google.type.TimeZone + * @static + * @param {google.type.ITimeZone} message TimeZone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZone.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.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + return writer; + }; + + /** + * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.TimeZone + * @static + * @param {google.type.ITimeZone} message TimeZone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZone.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeZone message from the specified reader or buffer. + * @function decode + * @memberof google.type.TimeZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.TimeZone} TimeZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZone.decode = function 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.TimeZone(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeZone message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.TimeZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.TimeZone} TimeZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZone.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeZone message. + * @function verify + * @memberof google.type.TimeZone + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeZone.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.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a TimeZone message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.TimeZone + * @static + * @param {Object.} object Plain object + * @returns {google.type.TimeZone} TimeZone + */ + TimeZone.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.TimeZone) + return object; + var message = new $root.google.type.TimeZone(); + if (object.id != null) + message.id = String(object.id); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a TimeZone message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.TimeZone + * @static + * @param {google.type.TimeZone} message TimeZone + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeZone.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.version = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this TimeZone to JSON. + * @function toJSON + * @memberof google.type.TimeZone + * @instance + * @returns {Object.} JSON object + */ + TimeZone.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeZone + * @function getTypeUrl + * @memberof google.type.TimeZone + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeZone.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.TimeZone"; + }; + + return TimeZone; + })(); + + /** + * DayOfWeek enum. + * @name google.type.DayOfWeek + * @enum {number} + * @property {number} DAY_OF_WEEK_UNSPECIFIED=0 DAY_OF_WEEK_UNSPECIFIED value + * @property {number} MONDAY=1 MONDAY value + * @property {number} TUESDAY=2 TUESDAY value + * @property {number} WEDNESDAY=3 WEDNESDAY value + * @property {number} THURSDAY=4 THURSDAY value + * @property {number} FRIDAY=5 FRIDAY value + * @property {number} SATURDAY=6 SATURDAY value + * @property {number} SUNDAY=7 SUNDAY value + */ + type.DayOfWeek = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONDAY"] = 1; + values[valuesById[2] = "TUESDAY"] = 2; + values[valuesById[3] = "WEDNESDAY"] = 3; + values[valuesById[4] = "THURSDAY"] = 4; + values[valuesById[5] = "FRIDAY"] = 5; + values[valuesById[6] = "SATURDAY"] = 6; + values[valuesById[7] = "SUNDAY"] = 7; + return values; + })(); + + type.TimeOfDay = (function() { + + /** + * Properties of a TimeOfDay. + * @memberof google.type + * @interface ITimeOfDay + * @property {number|null} [hours] TimeOfDay hours + * @property {number|null} [minutes] TimeOfDay minutes + * @property {number|null} [seconds] TimeOfDay seconds + * @property {number|null} [nanos] TimeOfDay nanos + */ + + /** + * Constructs a new TimeOfDay. + * @memberof google.type + * @classdesc Represents a TimeOfDay. + * @implements ITimeOfDay + * @constructor + * @param {google.type.ITimeOfDay=} [properties] Properties to set + */ + function TimeOfDay(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeOfDay hours. + * @member {number} hours + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.hours = 0; + + /** + * TimeOfDay minutes. + * @member {number} minutes + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.minutes = 0; + + /** + * TimeOfDay seconds. + * @member {number} seconds + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.seconds = 0; + + /** + * TimeOfDay nanos. + * @member {number} nanos + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.nanos = 0; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @function create + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay=} [properties] Properties to set + * @returns {google.type.TimeOfDay} TimeOfDay instance + */ + TimeOfDay.create = function create(properties) { + return new TimeOfDay(properties); + }; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encode + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hours); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minutes); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @function decode + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decode = function 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.TimeOfDay(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hours = reader.int32(); + break; + } + case 2: { + message.minutes = reader.int32(); + break; + } + case 3: { + message.seconds = reader.int32(); + break; + } + case 4: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeOfDay message. + * @function verify + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeOfDay.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hours != null && message.hasOwnProperty("hours")) + if (!$util.isInteger(message.hours)) + return "hours: integer expected"; + if (message.minutes != null && message.hasOwnProperty("minutes")) + if (!$util.isInteger(message.minutes)) + return "minutes: integer expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} object Plain object + * @returns {google.type.TimeOfDay} TimeOfDay + */ + TimeOfDay.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.TimeOfDay) + return object; + var message = new $root.google.type.TimeOfDay(); + if (object.hours != null) + message.hours = object.hours | 0; + if (object.minutes != null) + message.minutes = object.minutes | 0; + if (object.seconds != null) + message.seconds = object.seconds | 0; + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.TimeOfDay} message TimeOfDay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeOfDay.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hours = 0; + object.minutes = 0; + object.seconds = 0; + object.nanos = 0; + } + if (message.hours != null && message.hasOwnProperty("hours")) + object.hours = message.hours; + if (message.minutes != null && message.hasOwnProperty("minutes")) + object.minutes = message.minutes; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this TimeOfDay to JSON. + * @function toJSON + * @memberof google.type.TimeOfDay + * @instance + * @returns {Object.} JSON object + */ + TimeOfDay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeOfDay + * @function getTypeUrl + * @memberof google.type.TimeOfDay + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeOfDay.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.TimeOfDay"; + }; + + return TimeOfDay; + })(); + + 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-osconfig/protos/protos.json b/packages/google-cloud-osconfig/protos/protos.json new file mode 100644 index 00000000000..f77584b4d57 --- /dev/null +++ b/packages/google-cloud-osconfig/protos/protos.json @@ -0,0 +1,7327 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "osconfig": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.OsConfig.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig", + "java_multiple_files": true, + "java_outer_classname": "VulnerabilityProto", + "java_package": "com.google.cloud.osconfig.v1", + "php_namespace": "Google\\Cloud\\OsConfig\\V1", + "ruby_package": "Google::Cloud::OsConfig::V1", + "(google.api.resource_definition).type": "compute.googleapis.com/Instance", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/instances/{instance}" + }, + "nested": { + "Inventory": { + "options": { + "(google.api.resource).type": "osconfig.googleapis.com/Inventory", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}/inventory" + }, + "fields": { + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "osInfo": { + "type": "OsInfo", + "id": 1 + }, + "items": { + "keyType": "string", + "type": "Item", + "id": 2 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "OsInfo": { + "fields": { + "hostname": { + "type": "string", + "id": 9 + }, + "longName": { + "type": "string", + "id": 2 + }, + "shortName": { + "type": "string", + "id": 3 + }, + "version": { + "type": "string", + "id": 4 + }, + "architecture": { + "type": "string", + "id": 5 + }, + "kernelVersion": { + "type": "string", + "id": 6 + }, + "kernelRelease": { + "type": "string", + "id": 7 + }, + "osconfigAgentVersion": { + "type": "string", + "id": 8 + } + } + }, + "Item": { + "oneofs": { + "details": { + "oneof": [ + "installedPackage", + "availablePackage" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "originType": { + "type": "OriginType", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "type": { + "type": "Type", + "id": 5 + }, + "installedPackage": { + "type": "SoftwarePackage", + "id": 6 + }, + "availablePackage": { + "type": "SoftwarePackage", + "id": 7 + } + }, + "nested": { + "OriginType": { + "values": { + "ORIGIN_TYPE_UNSPECIFIED": 0, + "INVENTORY_REPORT": 1 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "INSTALLED_PACKAGE": 1, + "AVAILABLE_PACKAGE": 2 + } + } + } + }, + "SoftwarePackage": { + "oneofs": { + "details": { + "oneof": [ + "yumPackage", + "aptPackage", + "zypperPackage", + "googetPackage", + "zypperPatch", + "wuaPackage", + "qfePackage", + "cosPackage", + "windowsApplication" + ] + } + }, + "fields": { + "yumPackage": { + "type": "VersionedPackage", + "id": 1 + }, + "aptPackage": { + "type": "VersionedPackage", + "id": 2 + }, + "zypperPackage": { + "type": "VersionedPackage", + "id": 3 + }, + "googetPackage": { + "type": "VersionedPackage", + "id": 4 + }, + "zypperPatch": { + "type": "ZypperPatch", + "id": 5 + }, + "wuaPackage": { + "type": "WindowsUpdatePackage", + "id": 6 + }, + "qfePackage": { + "type": "WindowsQuickFixEngineeringPackage", + "id": 7 + }, + "cosPackage": { + "type": "VersionedPackage", + "id": 8 + }, + "windowsApplication": { + "type": "WindowsApplication", + "id": 9 + } + } + }, + "VersionedPackage": { + "fields": { + "packageName": { + "type": "string", + "id": 4 + }, + "architecture": { + "type": "string", + "id": 2 + }, + "version": { + "type": "string", + "id": 3 + } + } + }, + "ZypperPatch": { + "fields": { + "patchName": { + "type": "string", + "id": 5 + }, + "category": { + "type": "string", + "id": 2 + }, + "severity": { + "type": "string", + "id": 3 + }, + "summary": { + "type": "string", + "id": 4 + } + } + }, + "WindowsUpdatePackage": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "categories": { + "rule": "repeated", + "type": "WindowsUpdateCategory", + "id": 3 + }, + "kbArticleIds": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "supportUrl": { + "type": "string", + "id": 11 + }, + "moreInfoUrls": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "updateId": { + "type": "string", + "id": 6 + }, + "revisionNumber": { + "type": "int32", + "id": 7 + }, + "lastDeploymentChangeTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "WindowsUpdateCategory": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + } + } + }, + "WindowsQuickFixEngineeringPackage": { + "fields": { + "caption": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "hotFixId": { + "type": "string", + "id": 3 + }, + "installTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, + "WindowsApplication": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "displayVersion": { + "type": "string", + "id": 2 + }, + "publisher": { + "type": "string", + "id": 3 + }, + "installDate": { + "type": "google.type.Date", + "id": 4 + }, + "helpLink": { + "type": "string", + "id": 5 + } + } + } + } + }, + "GetInventoryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/Inventory" + } + }, + "view": { + "type": "InventoryView", + "id": 2 + } + } + }, + "ListInventoriesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Instance" + } + }, + "view": { + "type": "InventoryView", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5 + } + } + }, + "ListInventoriesResponse": { + "fields": { + "inventories": { + "rule": "repeated", + "type": "Inventory", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "InventoryView": { + "values": { + "INVENTORY_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + }, + "OSPolicy": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2 + }, + "mode": { + "type": "Mode", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceGroups": { + "rule": "repeated", + "type": "ResourceGroup", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowNoResourceGroupMatch": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "VALIDATION": 1, + "ENFORCEMENT": 2 + } + }, + "InventoryFilter": { + "fields": { + "osShortName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "osVersion": { + "type": "string", + "id": 2 + } + } + }, + "Resource": { + "oneofs": { + "resourceType": { + "oneof": [ + "pkg", + "repository", + "exec", + "file" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pkg": { + "type": "PackageResource", + "id": 2 + }, + "repository": { + "type": "RepositoryResource", + "id": 3 + }, + "exec": { + "type": "ExecResource", + "id": 4 + }, + "file": { + "type": "FileResource", + "id": 5 + } + }, + "nested": { + "File": { + "oneofs": { + "type": { + "oneof": [ + "remote", + "gcs", + "localPath" + ] + } + }, + "fields": { + "remote": { + "type": "Remote", + "id": 1 + }, + "gcs": { + "type": "Gcs", + "id": 2 + }, + "localPath": { + "type": "string", + "id": 3 + }, + "allowInsecure": { + "type": "bool", + "id": 4 + } + }, + "nested": { + "Remote": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sha256Checksum": { + "type": "string", + "id": 2 + } + } + }, + "Gcs": { + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "object": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "generation": { + "type": "int64", + "id": 3 + } + } + } + } + }, + "PackageResource": { + "oneofs": { + "systemPackage": { + "oneof": [ + "apt", + "deb", + "yum", + "zypper", + "rpm", + "googet", + "msi" + ] + } + }, + "fields": { + "desiredState": { + "type": "DesiredState", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apt": { + "type": "APT", + "id": 2 + }, + "deb": { + "type": "Deb", + "id": 3 + }, + "yum": { + "type": "YUM", + "id": 4 + }, + "zypper": { + "type": "Zypper", + "id": 5 + }, + "rpm": { + "type": "RPM", + "id": 6 + }, + "googet": { + "type": "GooGet", + "id": 7 + }, + "msi": { + "type": "MSI", + "id": 8 + } + }, + "nested": { + "DesiredState": { + "values": { + "DESIRED_STATE_UNSPECIFIED": 0, + "INSTALLED": 1, + "REMOVED": 2 + } + }, + "Deb": { + "fields": { + "source": { + "type": "File", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pullDeps": { + "type": "bool", + "id": 2 + } + } + }, + "APT": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RPM": { + "fields": { + "source": { + "type": "File", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pullDeps": { + "type": "bool", + "id": 2 + } + } + }, + "YUM": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Zypper": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GooGet": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MSI": { + "fields": { + "source": { + "type": "File", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "properties": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + }, + "RepositoryResource": { + "oneofs": { + "repository": { + "oneof": [ + "apt", + "yum", + "zypper", + "goo" + ] + } + }, + "fields": { + "apt": { + "type": "AptRepository", + "id": 1 + }, + "yum": { + "type": "YumRepository", + "id": 2 + }, + "zypper": { + "type": "ZypperRepository", + "id": 3 + }, + "goo": { + "type": "GooRepository", + "id": 4 + } + }, + "nested": { + "AptRepository": { + "fields": { + "archiveType": { + "type": "ArchiveType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "uri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "distribution": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "components": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gpgKey": { + "type": "string", + "id": 5 + } + }, + "nested": { + "ArchiveType": { + "values": { + "ARCHIVE_TYPE_UNSPECIFIED": 0, + "DEB": 1, + "DEB_SRC": 2 + } + } + } + }, + "YumRepository": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "baseUrl": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gpgKeys": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "ZypperRepository": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "baseUrl": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gpgKeys": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "GooRepository": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "url": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ExecResource": { + "fields": { + "validate": { + "type": "Exec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "enforce": { + "type": "Exec", + "id": 2 + } + }, + "nested": { + "Exec": { + "oneofs": { + "source": { + "oneof": [ + "file", + "script" + ] + } + }, + "fields": { + "file": { + "type": "File", + "id": 1 + }, + "script": { + "type": "string", + "id": 2 + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "interpreter": { + "type": "Interpreter", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputFilePath": { + "type": "string", + "id": 5 + } + }, + "nested": { + "Interpreter": { + "values": { + "INTERPRETER_UNSPECIFIED": 0, + "NONE": 1, + "SHELL": 2, + "POWERSHELL": 3 + } + } + } + } + } + }, + "FileResource": { + "oneofs": { + "source": { + "oneof": [ + "file", + "content" + ] + } + }, + "fields": { + "file": { + "type": "File", + "id": 1 + }, + "content": { + "type": "string", + "id": 2 + }, + "path": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "state": { + "type": "DesiredState", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "permissions": { + "type": "string", + "id": 5 + } + }, + "nested": { + "DesiredState": { + "values": { + "DESIRED_STATE_UNSPECIFIED": 0, + "PRESENT": 1, + "ABSENT": 2, + "CONTENTS_MATCH": 3 + } + } + } + } + } + }, + "ResourceGroup": { + "fields": { + "inventoryFilters": { + "rule": "repeated", + "type": "InventoryFilter", + "id": 1 + }, + "resources": { + "rule": "repeated", + "type": "Resource", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "GetOSPolicyAssignmentReportRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/OSPolicyAssignmentReport" + } + } + } + }, + "ListOSPolicyAssignmentReportsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/InstanceOSPolicyAssignment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListOSPolicyAssignmentReportsResponse": { + "fields": { + "osPolicyAssignmentReports": { + "rule": "repeated", + "type": "OSPolicyAssignmentReport", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "OSPolicyAssignmentReport": { + "options": { + "(google.api.resource).type": "osconfig.googleapis.com/OSPolicyAssignmentReport", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "instance": { + "type": "string", + "id": 2 + }, + "osPolicyAssignment": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "osconfig.googleapis.com/OSPolicyAssignment" + } + }, + "osPolicyCompliances": { + "rule": "repeated", + "type": "OSPolicyCompliance", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "lastRunId": { + "type": "string", + "id": 6 + } + }, + "nested": { + "OSPolicyCompliance": { + "fields": { + "osPolicyId": { + "type": "string", + "id": 1 + }, + "complianceState": { + "type": "ComplianceState", + "id": 2 + }, + "complianceStateReason": { + "type": "string", + "id": 3 + }, + "osPolicyResourceCompliances": { + "rule": "repeated", + "type": "OSPolicyResourceCompliance", + "id": 4 + } + }, + "nested": { + "ComplianceState": { + "values": { + "UNKNOWN": 0, + "COMPLIANT": 1, + "NON_COMPLIANT": 2 + } + }, + "OSPolicyResourceCompliance": { + "oneofs": { + "output": { + "oneof": [ + "execResourceOutput" + ] + } + }, + "fields": { + "osPolicyResourceId": { + "type": "string", + "id": 1 + }, + "configSteps": { + "rule": "repeated", + "type": "OSPolicyResourceConfigStep", + "id": 2 + }, + "complianceState": { + "type": "ComplianceState", + "id": 3 + }, + "complianceStateReason": { + "type": "string", + "id": 4 + }, + "execResourceOutput": { + "type": "ExecResourceOutput", + "id": 5 + } + }, + "nested": { + "OSPolicyResourceConfigStep": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "errorMessage": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "VALIDATION": 1, + "DESIRED_STATE_CHECK": 2, + "DESIRED_STATE_ENFORCEMENT": 3, + "DESIRED_STATE_CHECK_POST_ENFORCEMENT": 4 + } + } + } + }, + "ComplianceState": { + "values": { + "UNKNOWN": 0, + "COMPLIANT": 1, + "NON_COMPLIANT": 2 + } + }, + "ExecResourceOutput": { + "fields": { + "enforcementOutput": { + "type": "bytes", + "id": 2 + } + } + } + } + } + } + } + } + }, + "OSPolicyAssignment": { + "options": { + "(google.api.resource).type": "osconfig.googleapis.com/OSPolicyAssignment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "osPolicies": { + "rule": "repeated", + "type": "OSPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceFilter": { + "type": "InstanceFilter", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rollout": { + "type": "Rollout", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "revisionId": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 8 + }, + "rolloutState": { + "type": "RolloutState", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "baseline": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleted": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LabelSet": { + "fields": { + "labels": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + }, + "InstanceFilter": { + "fields": { + "all": { + "type": "bool", + "id": 1 + }, + "inclusionLabels": { + "rule": "repeated", + "type": "LabelSet", + "id": 2 + }, + "exclusionLabels": { + "rule": "repeated", + "type": "LabelSet", + "id": 3 + }, + "inventories": { + "rule": "repeated", + "type": "Inventory", + "id": 4 + } + }, + "nested": { + "Inventory": { + "fields": { + "osShortName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "osVersion": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Rollout": { + "fields": { + "disruptionBudget": { + "type": "FixedOrPercent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "minWaitDuration": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RolloutState": { + "values": { + "ROLLOUT_STATE_UNSPECIFIED": 0, + "IN_PROGRESS": 1, + "CANCELLING": 2, + "CANCELLED": 3, + "SUCCEEDED": 4 + } + } + } + }, + "OSPolicyAssignmentOperationMetadata": { + "fields": { + "osPolicyAssignment": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "osconfig.googleapis.com/OSPolicyAssignment" + } + }, + "apiMethod": { + "type": "APIMethod", + "id": 2 + }, + "rolloutState": { + "type": "RolloutState", + "id": 3 + }, + "rolloutStartTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "rolloutUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + }, + "nested": { + "APIMethod": { + "values": { + "API_METHOD_UNSPECIFIED": 0, + "CREATE": 1, + "UPDATE": 2, + "DELETE": 3 + } + }, + "RolloutState": { + "values": { + "ROLLOUT_STATE_UNSPECIFIED": 0, + "IN_PROGRESS": 1, + "CANCELLING": 2, + "CANCELLED": 3, + "SUCCEEDED": 4 + } + } + } + }, + "CreateOSPolicyAssignmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "osPolicyAssignment": { + "type": "OSPolicyAssignment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "osPolicyAssignmentId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateOSPolicyAssignmentRequest": { + "fields": { + "osPolicyAssignment": { + "type": "OSPolicyAssignment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetOSPolicyAssignmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/OSPolicyAssignment" + } + } + } + }, + "ListOSPolicyAssignmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOSPolicyAssignmentsResponse": { + "fields": { + "osPolicyAssignments": { + "rule": "repeated", + "type": "OSPolicyAssignment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListOSPolicyAssignmentRevisionsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/OSPolicyAssignment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOSPolicyAssignmentRevisionsResponse": { + "fields": { + "osPolicyAssignments": { + "rule": "repeated", + "type": "OSPolicyAssignment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteOSPolicyAssignmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/OSPolicyAssignment" + } + } + } + }, + "FixedOrPercent": { + "oneofs": { + "mode": { + "oneof": [ + "fixed", + "percent" + ] + } + }, + "fields": { + "fixed": { + "type": "int32", + "id": 1 + }, + "percent": { + "type": "int32", + "id": 2 + } + } + }, + "OsConfigService": { + "options": { + "(google.api.default_host)": "osconfig.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ExecutePatchJob": { + "requestType": "ExecutePatchJobRequest", + "responseType": "PatchJob", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/patchJobs:execute", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/patchJobs:execute", + "body": "*" + } + } + ] + }, + "GetPatchJob": { + "requestType": "GetPatchJobRequest", + "responseType": "PatchJob", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/patchJobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/patchJobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelPatchJob": { + "requestType": "CancelPatchJobRequest", + "responseType": "PatchJob", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/patchJobs/*}:cancel", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/patchJobs/*}:cancel", + "body": "*" + } + } + ] + }, + "ListPatchJobs": { + "requestType": "ListPatchJobsRequest", + "responseType": "ListPatchJobsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/patchJobs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/patchJobs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListPatchJobInstanceDetails": { + "requestType": "ListPatchJobInstanceDetailsRequest", + "responseType": "ListPatchJobInstanceDetailsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/patchJobs/*}/instanceDetails", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/patchJobs/*}/instanceDetails" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreatePatchDeployment": { + "requestType": "CreatePatchDeploymentRequest", + "responseType": "PatchDeployment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/patchDeployments", + "(google.api.http).body": "patch_deployment", + "(google.api.method_signature)": "parent,patch_deployment,patch_deployment_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/patchDeployments", + "body": "patch_deployment" + } + }, + { + "(google.api.method_signature)": "parent,patch_deployment,patch_deployment_id" + } + ] + }, + "GetPatchDeployment": { + "requestType": "GetPatchDeploymentRequest", + "responseType": "PatchDeployment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/patchDeployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/patchDeployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPatchDeployments": { + "requestType": "ListPatchDeploymentsRequest", + "responseType": "ListPatchDeploymentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/patchDeployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/patchDeployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeletePatchDeployment": { + "requestType": "DeletePatchDeploymentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/patchDeployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/patchDeployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdatePatchDeployment": { + "requestType": "UpdatePatchDeploymentRequest", + "responseType": "PatchDeployment", + "options": { + "(google.api.http).patch": "/v1/{patch_deployment.name=projects/*/patchDeployments/*}", + "(google.api.http).body": "patch_deployment", + "(google.api.method_signature)": "patch_deployment,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{patch_deployment.name=projects/*/patchDeployments/*}", + "body": "patch_deployment" + } + }, + { + "(google.api.method_signature)": "patch_deployment,update_mask" + } + ] + }, + "PausePatchDeployment": { + "requestType": "PausePatchDeploymentRequest", + "responseType": "PatchDeployment", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/patchDeployments/*}:pause", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/patchDeployments/*}:pause", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ResumePatchDeployment": { + "requestType": "ResumePatchDeploymentRequest", + "responseType": "PatchDeployment", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/patchDeployments/*}:resume", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/patchDeployments/*}:resume", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "PatchDeployment": { + "options": { + "(google.api.resource).type": "osconfig.googleapis.com/PatchDeployment", + "(google.api.resource).pattern": "projects/{project}/patchDeployments/{patch_deployment}" + }, + "oneofs": { + "schedule": { + "oneof": [ + "oneTimeSchedule", + "recurringSchedule" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instanceFilter": { + "type": "PatchInstanceFilter", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "patchConfig": { + "type": "PatchConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "oneTimeSchedule": { + "type": "OneTimeSchedule", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "recurringSchedule": { + "type": "RecurringSchedule", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastExecuteTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "rollout": { + "type": "PatchRollout", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "PAUSED": 2 + } + } + } + }, + "OneTimeSchedule": { + "fields": { + "executeTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RecurringSchedule": { + "oneofs": { + "scheduleConfig": { + "oneof": [ + "weekly", + "monthly" + ] + } + }, + "fields": { + "timeZone": { + "type": "google.type.TimeZone", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeOfDay": { + "type": "google.type.TimeOfDay", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "frequency": { + "type": "Frequency", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "weekly": { + "type": "WeeklySchedule", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "monthly": { + "type": "MonthlySchedule", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "lastExecuteTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextExecuteTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Frequency": { + "values": { + "FREQUENCY_UNSPECIFIED": 0, + "WEEKLY": 1, + "MONTHLY": 2, + "DAILY": 3 + } + } + } + }, + "WeeklySchedule": { + "fields": { + "dayOfWeek": { + "type": "google.type.DayOfWeek", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MonthlySchedule": { + "oneofs": { + "dayOfMonth": { + "oneof": [ + "weekDayOfMonth", + "monthDay" + ] + } + }, + "fields": { + "weekDayOfMonth": { + "type": "WeekDayOfMonth", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "monthDay": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "WeekDayOfMonth": { + "fields": { + "weekOrdinal": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dayOfWeek": { + "type": "google.type.DayOfWeek", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dayOffset": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreatePatchDeploymentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "patchDeploymentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "patchDeployment": { + "type": "PatchDeployment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetPatchDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/PatchDeployment" + } + } + } + }, + "ListPatchDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListPatchDeploymentsResponse": { + "fields": { + "patchDeployments": { + "rule": "repeated", + "type": "PatchDeployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeletePatchDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/PatchDeployment" + } + } + } + }, + "UpdatePatchDeploymentRequest": { + "fields": { + "patchDeployment": { + "type": "PatchDeployment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PausePatchDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/PatchDeployment" + } + } + } + }, + "ResumePatchDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/PatchDeployment" + } + } + } + }, + "ExecutePatchJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "description": { + "type": "string", + "id": 2 + }, + "instanceFilter": { + "type": "PatchInstanceFilter", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "patchConfig": { + "type": "PatchConfig", + "id": 4 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "dryRun": { + "type": "bool", + "id": 6 + }, + "displayName": { + "type": "string", + "id": 8 + }, + "rollout": { + "type": "PatchRollout", + "id": 9 + } + } + }, + "GetPatchJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/PatchJob" + } + } + } + }, + "ListPatchJobInstanceDetailsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/PatchJob" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListPatchJobInstanceDetailsResponse": { + "fields": { + "patchJobInstanceDetails": { + "rule": "repeated", + "type": "PatchJobInstanceDetails", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "PatchJobInstanceDetails": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "compute.googleapis.com/Instance" + } + }, + "instanceSystemId": { + "type": "string", + "id": 2 + }, + "state": { + "type": "Instance.PatchState", + "id": 3 + }, + "failureReason": { + "type": "string", + "id": 4 + }, + "attemptCount": { + "type": "int64", + "id": 5 + } + } + }, + "ListPatchJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListPatchJobsResponse": { + "fields": { + "patchJobs": { + "rule": "repeated", + "type": "PatchJob", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "PatchJob": { + "options": { + "(google.api.resource).type": "osconfig.googleapis.com/PatchJob", + "(google.api.resource).pattern": "projects/{project}/patchJobs/{patch_job}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 14 + }, + "description": { + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "state": { + "type": "State", + "id": 5 + }, + "instanceFilter": { + "type": "PatchInstanceFilter", + "id": 13 + }, + "patchConfig": { + "type": "PatchConfig", + "id": 7 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "instanceDetailsSummary": { + "type": "InstanceDetailsSummary", + "id": 9 + }, + "dryRun": { + "type": "bool", + "id": 10 + }, + "errorMessage": { + "type": "string", + "id": 11 + }, + "percentComplete": { + "type": "double", + "id": 12 + }, + "patchDeployment": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "osconfig.googleapis.com/PatchDeployment" + } + }, + "rollout": { + "type": "PatchRollout", + "id": 16 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "STARTED": 1, + "INSTANCE_LOOKUP": 2, + "PATCHING": 3, + "SUCCEEDED": 4, + "COMPLETED_WITH_ERRORS": 5, + "CANCELED": 6, + "TIMED_OUT": 7 + } + }, + "InstanceDetailsSummary": { + "fields": { + "pendingInstanceCount": { + "type": "int64", + "id": 1 + }, + "inactiveInstanceCount": { + "type": "int64", + "id": 2 + }, + "notifiedInstanceCount": { + "type": "int64", + "id": 3 + }, + "startedInstanceCount": { + "type": "int64", + "id": 4 + }, + "downloadingPatchesInstanceCount": { + "type": "int64", + "id": 5 + }, + "applyingPatchesInstanceCount": { + "type": "int64", + "id": 6 + }, + "rebootingInstanceCount": { + "type": "int64", + "id": 7 + }, + "succeededInstanceCount": { + "type": "int64", + "id": 8 + }, + "succeededRebootRequiredInstanceCount": { + "type": "int64", + "id": 9 + }, + "failedInstanceCount": { + "type": "int64", + "id": 10 + }, + "ackedInstanceCount": { + "type": "int64", + "id": 11 + }, + "timedOutInstanceCount": { + "type": "int64", + "id": 12 + }, + "prePatchStepInstanceCount": { + "type": "int64", + "id": 13 + }, + "postPatchStepInstanceCount": { + "type": "int64", + "id": 14 + }, + "noAgentDetectedInstanceCount": { + "type": "int64", + "id": 15 + } + } + } + } + }, + "PatchConfig": { + "fields": { + "rebootConfig": { + "type": "RebootConfig", + "id": 1 + }, + "apt": { + "type": "AptSettings", + "id": 3 + }, + "yum": { + "type": "YumSettings", + "id": 4 + }, + "goo": { + "type": "GooSettings", + "id": 5 + }, + "zypper": { + "type": "ZypperSettings", + "id": 6 + }, + "windowsUpdate": { + "type": "WindowsUpdateSettings", + "id": 7 + }, + "preStep": { + "type": "ExecStep", + "id": 8 + }, + "postStep": { + "type": "ExecStep", + "id": 9 + }, + "migInstancesAllowed": { + "type": "bool", + "id": 10 + } + }, + "nested": { + "RebootConfig": { + "values": { + "REBOOT_CONFIG_UNSPECIFIED": 0, + "DEFAULT": 1, + "ALWAYS": 2, + "NEVER": 3 + } + } + } + }, + "Instance": { + "fields": {}, + "nested": { + "PatchState": { + "values": { + "PATCH_STATE_UNSPECIFIED": 0, + "PENDING": 1, + "INACTIVE": 2, + "NOTIFIED": 3, + "STARTED": 4, + "DOWNLOADING_PATCHES": 5, + "APPLYING_PATCHES": 6, + "REBOOTING": 7, + "SUCCEEDED": 8, + "SUCCEEDED_REBOOT_REQUIRED": 9, + "FAILED": 10, + "ACKED": 11, + "TIMED_OUT": 12, + "RUNNING_PRE_PATCH_STEP": 13, + "RUNNING_POST_PATCH_STEP": 14, + "NO_AGENT_DETECTED": 15 + } + } + } + }, + "CancelPatchJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/PatchJob" + } + } + } + }, + "AptSettings": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "excludes": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "exclusivePackages": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "DIST": 1, + "UPGRADE": 2 + } + } + } + }, + "YumSettings": { + "fields": { + "security": { + "type": "bool", + "id": 1 + }, + "minimal": { + "type": "bool", + "id": 2 + }, + "excludes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "exclusivePackages": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "GooSettings": { + "fields": {} + }, + "ZypperSettings": { + "fields": { + "withOptional": { + "type": "bool", + "id": 1 + }, + "withUpdate": { + "type": "bool", + "id": 2 + }, + "categories": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "severities": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "excludes": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "exclusivePatches": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "WindowsUpdateSettings": { + "fields": { + "classifications": { + "rule": "repeated", + "type": "Classification", + "id": 1 + }, + "excludes": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "exclusivePatches": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "Classification": { + "values": { + "CLASSIFICATION_UNSPECIFIED": 0, + "CRITICAL": 1, + "SECURITY": 2, + "DEFINITION": 3, + "DRIVER": 4, + "FEATURE_PACK": 5, + "SERVICE_PACK": 6, + "TOOL": 7, + "UPDATE_ROLLUP": 8, + "UPDATE": 9 + } + } + } + }, + "ExecStep": { + "fields": { + "linuxExecStepConfig": { + "type": "ExecStepConfig", + "id": 1 + }, + "windowsExecStepConfig": { + "type": "ExecStepConfig", + "id": 2 + } + } + }, + "ExecStepConfig": { + "oneofs": { + "executable": { + "oneof": [ + "localPath", + "gcsObject" + ] + } + }, + "fields": { + "localPath": { + "type": "string", + "id": 1 + }, + "gcsObject": { + "type": "GcsObject", + "id": 2 + }, + "allowedSuccessCodes": { + "rule": "repeated", + "type": "int32", + "id": 3 + }, + "interpreter": { + "type": "Interpreter", + "id": 4 + } + }, + "nested": { + "Interpreter": { + "values": { + "INTERPRETER_UNSPECIFIED": 0, + "SHELL": 1, + "POWERSHELL": 2 + } + } + } + }, + "GcsObject": { + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "object": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "generationNumber": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PatchInstanceFilter": { + "fields": { + "all": { + "type": "bool", + "id": 1 + }, + "groupLabels": { + "rule": "repeated", + "type": "GroupLabel", + "id": 2 + }, + "zones": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "instances": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "instanceNamePrefixes": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "GroupLabel": { + "fields": { + "labels": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + } + } + }, + "PatchRollout": { + "fields": { + "mode": { + "type": "Mode", + "id": 1 + }, + "disruptionBudget": { + "type": "FixedOrPercent", + "id": 2 + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "ZONE_BY_ZONE": 1, + "CONCURRENT_ZONES": 2 + } + } + } + }, + "OsConfigZonalService": { + "options": { + "(google.api.default_host)": "osconfig.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateOSPolicyAssignment": { + "requestType": "CreateOSPolicyAssignmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/osPolicyAssignments", + "(google.api.http).body": "os_policy_assignment", + "(google.api.method_signature)": "parent,os_policy_assignment,os_policy_assignment_id", + "(google.longrunning.operation_info).response_type": "OSPolicyAssignment", + "(google.longrunning.operation_info).metadata_type": "OSPolicyAssignmentOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/osPolicyAssignments", + "body": "os_policy_assignment" + } + }, + { + "(google.api.method_signature)": "parent,os_policy_assignment,os_policy_assignment_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "OSPolicyAssignment", + "metadata_type": "OSPolicyAssignmentOperationMetadata" + } + } + ] + }, + "UpdateOSPolicyAssignment": { + "requestType": "UpdateOSPolicyAssignmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{os_policy_assignment.name=projects/*/locations/*/osPolicyAssignments/*}", + "(google.api.http).body": "os_policy_assignment", + "(google.api.method_signature)": "os_policy_assignment,update_mask", + "(google.longrunning.operation_info).response_type": "OSPolicyAssignment", + "(google.longrunning.operation_info).metadata_type": "OSPolicyAssignmentOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{os_policy_assignment.name=projects/*/locations/*/osPolicyAssignments/*}", + "body": "os_policy_assignment" + } + }, + { + "(google.api.method_signature)": "os_policy_assignment,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "OSPolicyAssignment", + "metadata_type": "OSPolicyAssignmentOperationMetadata" + } + } + ] + }, + "GetOSPolicyAssignment": { + "requestType": "GetOSPolicyAssignmentRequest", + "responseType": "OSPolicyAssignment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListOSPolicyAssignments": { + "requestType": "ListOSPolicyAssignmentsRequest", + "responseType": "ListOSPolicyAssignmentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/osPolicyAssignments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/osPolicyAssignments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListOSPolicyAssignmentRevisions": { + "requestType": "ListOSPolicyAssignmentRevisionsRequest", + "responseType": "ListOSPolicyAssignmentRevisionsResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}:listRevisions", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}:listRevisions" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOSPolicyAssignment": { + "requestType": "DeleteOSPolicyAssignmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OSPolicyAssignmentOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OSPolicyAssignmentOperationMetadata" + } + } + ] + }, + "GetOSPolicyAssignmentReport": { + "requestType": "GetOSPolicyAssignmentReportRequest", + "responseType": "OSPolicyAssignmentReport", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/instances/*/osPolicyAssignments/*/report}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/instances/*/osPolicyAssignments/*/report}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListOSPolicyAssignmentReports": { + "requestType": "ListOSPolicyAssignmentReportsRequest", + "responseType": "ListOSPolicyAssignmentReportsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/instances/*/osPolicyAssignments/*}/reports", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/instances/*/osPolicyAssignments/*}/reports" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInventory": { + "requestType": "GetInventoryRequest", + "responseType": "Inventory", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/instances/*/inventory}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/instances/*/inventory}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListInventories": { + "requestType": "ListInventoriesRequest", + "responseType": "ListInventoriesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/instances/*}/inventories", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/instances/*}/inventories" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetVulnerabilityReport": { + "requestType": "GetVulnerabilityReportRequest", + "responseType": "VulnerabilityReport", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/instances/*/vulnerabilityReport}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/instances/*/vulnerabilityReport}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListVulnerabilityReports": { + "requestType": "ListVulnerabilityReportsRequest", + "responseType": "ListVulnerabilityReportsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "VulnerabilityReport": { + "options": { + "(google.api.resource).type": "osconfig.googleapis.com/VulnerabilityReport", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vulnerabilities": { + "rule": "repeated", + "type": "Vulnerability", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Vulnerability": { + "fields": { + "details": { + "type": "Details", + "id": 1 + }, + "installedInventoryItemIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "availableInventoryItemIds": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "deprecated": true + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "items": { + "rule": "repeated", + "type": "Item", + "id": 6 + } + }, + "nested": { + "Details": { + "fields": { + "cve": { + "type": "string", + "id": 1 + }, + "cvssV2Score": { + "type": "float", + "id": 2 + }, + "cvssV3": { + "type": "CVSSv3", + "id": 3 + }, + "severity": { + "type": "string", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "references": { + "rule": "repeated", + "type": "Reference", + "id": 6 + } + }, + "nested": { + "Reference": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "source": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Item": { + "fields": { + "installedInventoryItemId": { + "type": "string", + "id": 1 + }, + "availableInventoryItemId": { + "type": "string", + "id": 2 + }, + "fixedCpeUri": { + "type": "string", + "id": 3 + }, + "upstreamFix": { + "type": "string", + "id": 4 + } + } + } + } + } + } + }, + "GetVulnerabilityReportRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/VulnerabilityReport" + } + } + } + }, + "ListVulnerabilityReportsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListVulnerabilityReportsResponse": { + "fields": { + "vulnerabilityReports": { + "rule": "repeated", + "type": "VulnerabilityReport", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CVSSv3": { + "fields": { + "baseScore": { + "type": "float", + "id": 1 + }, + "exploitabilityScore": { + "type": "float", + "id": 2 + }, + "impactScore": { + "type": "float", + "id": 3 + }, + "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 + } + } + } + } + } + }, + "v1alpha": { + "options": { + "csharp_namespace": "Google.Cloud.OsConfig.V1Alpha", + "go_package": "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig", + "java_multiple_files": true, + "java_outer_classname": "VulnerabilityProto", + "java_package": "com.google.cloud.osconfig.v1alpha", + "php_namespace": "Google\\Cloud\\OsConfig\\V1alpha", + "ruby_package": "Google::Cloud::OsConfig::V1alpha", + "(google.api.resource_definition).type": "compute.googleapis.com/Instance", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/instances/{instance}" + }, + "nested": { + "OSPolicyResourceConfigStep": { + "options": { + "deprecated": true + }, + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "outcome": { + "type": "Outcome", + "id": 2 + }, + "errorMessage": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Type": { + "options": { + "deprecated": true + }, + "values": { + "TYPE_UNSPECIFIED": 0, + "VALIDATION": 1, + "DESIRED_STATE_CHECK": 2, + "DESIRED_STATE_ENFORCEMENT": 3, + "DESIRED_STATE_CHECK_POST_ENFORCEMENT": 4 + } + }, + "Outcome": { + "options": { + "deprecated": true + }, + "values": { + "OUTCOME_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2 + } + } + } + }, + "OSPolicyResourceCompliance": { + "options": { + "deprecated": true + }, + "oneofs": { + "output": { + "oneof": [ + "execResourceOutput" + ] + } + }, + "fields": { + "osPolicyResourceId": { + "type": "string", + "id": 1 + }, + "configSteps": { + "rule": "repeated", + "type": "OSPolicyResourceConfigStep", + "id": 2 + }, + "state": { + "type": "OSPolicyComplianceState", + "id": 3 + }, + "execResourceOutput": { + "type": "ExecResourceOutput", + "id": 4 + } + }, + "nested": { + "ExecResourceOutput": { + "options": { + "deprecated": true + }, + "fields": { + "enforcementOutput": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "OSPolicyComplianceState": { + "options": { + "deprecated": true + }, + "values": { + "OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED": 0, + "COMPLIANT": 1, + "NON_COMPLIANT": 2, + "UNKNOWN": 3, + "NO_OS_POLICIES_APPLICABLE": 4 + } + }, + "InstanceOSPoliciesCompliance": { + "options": { + "deprecated": true, + "(google.api.resource).type": "osconfig.googleapis.com/InstanceOSPoliciesCompliance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instanceOSPoliciesCompliances/{instance}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instance": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "OSPolicyComplianceState", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "detailedState": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "detailedStateReason": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "osPolicyCompliances": { + "rule": "repeated", + "type": "OSPolicyCompliance", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastComplianceCheckTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastComplianceRunId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "OSPolicyCompliance": { + "options": { + "deprecated": true + }, + "fields": { + "osPolicyId": { + "type": "string", + "id": 1 + }, + "osPolicyAssignment": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "osconfig.googleapis.com/OSPolicyAssignment" + } + }, + "state": { + "type": "OSPolicyComplianceState", + "id": 4 + }, + "osPolicyResourceCompliances": { + "rule": "repeated", + "type": "OSPolicyResourceCompliance", + "id": 5 + } + } + } + } + }, + "GetInstanceOSPoliciesComplianceRequest": { + "options": { + "deprecated": true + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/InstanceOSPoliciesCompliance" + } + } + } + }, + "ListInstanceOSPoliciesCompliancesRequest": { + "options": { + "deprecated": true + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListInstanceOSPoliciesCompliancesResponse": { + "options": { + "deprecated": true + }, + "fields": { + "instanceOsPoliciesCompliances": { + "rule": "repeated", + "type": "InstanceOSPoliciesCompliance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Inventory": { + "options": { + "(google.api.resource).type": "osconfig.googleapis.com/Inventory", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}/inventory" + }, + "fields": { + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "osInfo": { + "type": "OsInfo", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "items": { + "keyType": "string", + "type": "Item", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "OsInfo": { + "fields": { + "hostname": { + "type": "string", + "id": 9 + }, + "longName": { + "type": "string", + "id": 2 + }, + "shortName": { + "type": "string", + "id": 3 + }, + "version": { + "type": "string", + "id": 4 + }, + "architecture": { + "type": "string", + "id": 5 + }, + "kernelVersion": { + "type": "string", + "id": 6 + }, + "kernelRelease": { + "type": "string", + "id": 7 + }, + "osconfigAgentVersion": { + "type": "string", + "id": 8 + } + } + }, + "Item": { + "oneofs": { + "details": { + "oneof": [ + "installedPackage", + "availablePackage" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "originType": { + "type": "OriginType", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "type": { + "type": "Type", + "id": 5 + }, + "installedPackage": { + "type": "SoftwarePackage", + "id": 6 + }, + "availablePackage": { + "type": "SoftwarePackage", + "id": 7 + } + }, + "nested": { + "OriginType": { + "values": { + "ORIGIN_TYPE_UNSPECIFIED": 0, + "INVENTORY_REPORT": 1 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "INSTALLED_PACKAGE": 1, + "AVAILABLE_PACKAGE": 2 + } + } + } + }, + "SoftwarePackage": { + "oneofs": { + "details": { + "oneof": [ + "yumPackage", + "aptPackage", + "zypperPackage", + "googetPackage", + "zypperPatch", + "wuaPackage", + "qfePackage", + "cosPackage", + "windowsApplication" + ] + } + }, + "fields": { + "yumPackage": { + "type": "VersionedPackage", + "id": 1 + }, + "aptPackage": { + "type": "VersionedPackage", + "id": 2 + }, + "zypperPackage": { + "type": "VersionedPackage", + "id": 3 + }, + "googetPackage": { + "type": "VersionedPackage", + "id": 4 + }, + "zypperPatch": { + "type": "ZypperPatch", + "id": 5 + }, + "wuaPackage": { + "type": "WindowsUpdatePackage", + "id": 6 + }, + "qfePackage": { + "type": "WindowsQuickFixEngineeringPackage", + "id": 7 + }, + "cosPackage": { + "type": "VersionedPackage", + "id": 8 + }, + "windowsApplication": { + "type": "WindowsApplication", + "id": 9 + } + } + }, + "VersionedPackage": { + "fields": { + "packageName": { + "type": "string", + "id": 4 + }, + "architecture": { + "type": "string", + "id": 2 + }, + "version": { + "type": "string", + "id": 3 + } + } + }, + "ZypperPatch": { + "fields": { + "patchName": { + "type": "string", + "id": 5 + }, + "category": { + "type": "string", + "id": 2 + }, + "severity": { + "type": "string", + "id": 3 + }, + "summary": { + "type": "string", + "id": 4 + } + } + }, + "WindowsUpdatePackage": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "categories": { + "rule": "repeated", + "type": "WindowsUpdateCategory", + "id": 3 + }, + "kbArticleIds": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "supportUrl": { + "type": "string", + "id": 11 + }, + "moreInfoUrls": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "updateId": { + "type": "string", + "id": 6 + }, + "revisionNumber": { + "type": "int32", + "id": 7 + }, + "lastDeploymentChangeTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "WindowsUpdateCategory": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + } + } + }, + "WindowsQuickFixEngineeringPackage": { + "fields": { + "caption": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "hotFixId": { + "type": "string", + "id": 3 + }, + "installTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, + "WindowsApplication": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "displayVersion": { + "type": "string", + "id": 2 + }, + "publisher": { + "type": "string", + "id": 3 + }, + "installDate": { + "type": "google.type.Date", + "id": 4 + }, + "helpLink": { + "type": "string", + "id": 5 + } + } + } + } + }, + "GetInventoryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/Inventory" + } + }, + "view": { + "type": "InventoryView", + "id": 2 + } + } + }, + "ListInventoriesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Instance" + } + }, + "view": { + "type": "InventoryView", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5 + } + } + }, + "ListInventoriesResponse": { + "fields": { + "inventories": { + "rule": "repeated", + "type": "Inventory", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "InventoryView": { + "values": { + "INVENTORY_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + }, + "OSPolicy": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2 + }, + "mode": { + "type": "Mode", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceGroups": { + "rule": "repeated", + "type": "ResourceGroup", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowNoResourceGroupMatch": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "VALIDATION": 1, + "ENFORCEMENT": 2 + } + }, + "OSFilter": { + "fields": { + "osShortName": { + "type": "string", + "id": 1 + }, + "osVersion": { + "type": "string", + "id": 2 + } + } + }, + "InventoryFilter": { + "fields": { + "osShortName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "osVersion": { + "type": "string", + "id": 2 + } + } + }, + "Resource": { + "oneofs": { + "resourceType": { + "oneof": [ + "pkg", + "repository", + "exec", + "file" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pkg": { + "type": "PackageResource", + "id": 2 + }, + "repository": { + "type": "RepositoryResource", + "id": 3 + }, + "exec": { + "type": "ExecResource", + "id": 4 + }, + "file": { + "type": "FileResource", + "id": 5 + } + }, + "nested": { + "File": { + "oneofs": { + "type": { + "oneof": [ + "remote", + "gcs", + "localPath" + ] + } + }, + "fields": { + "remote": { + "type": "Remote", + "id": 1 + }, + "gcs": { + "type": "Gcs", + "id": 2 + }, + "localPath": { + "type": "string", + "id": 3 + }, + "allowInsecure": { + "type": "bool", + "id": 4 + } + }, + "nested": { + "Remote": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sha256Checksum": { + "type": "string", + "id": 2 + } + } + }, + "Gcs": { + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "object": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "generation": { + "type": "int64", + "id": 3 + } + } + } + } + }, + "PackageResource": { + "oneofs": { + "systemPackage": { + "oneof": [ + "apt", + "deb", + "yum", + "zypper", + "rpm", + "googet", + "msi" + ] + } + }, + "fields": { + "desiredState": { + "type": "DesiredState", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apt": { + "type": "APT", + "id": 2 + }, + "deb": { + "type": "Deb", + "id": 3 + }, + "yum": { + "type": "YUM", + "id": 4 + }, + "zypper": { + "type": "Zypper", + "id": 5 + }, + "rpm": { + "type": "RPM", + "id": 6 + }, + "googet": { + "type": "GooGet", + "id": 7 + }, + "msi": { + "type": "MSI", + "id": 8 + } + }, + "nested": { + "DesiredState": { + "values": { + "DESIRED_STATE_UNSPECIFIED": 0, + "INSTALLED": 1, + "REMOVED": 2 + } + }, + "Deb": { + "fields": { + "source": { + "type": "File", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pullDeps": { + "type": "bool", + "id": 2 + } + } + }, + "APT": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RPM": { + "fields": { + "source": { + "type": "File", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pullDeps": { + "type": "bool", + "id": 2 + } + } + }, + "YUM": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Zypper": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GooGet": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MSI": { + "fields": { + "source": { + "type": "File", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "properties": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + }, + "RepositoryResource": { + "oneofs": { + "repository": { + "oneof": [ + "apt", + "yum", + "zypper", + "goo" + ] + } + }, + "fields": { + "apt": { + "type": "AptRepository", + "id": 1 + }, + "yum": { + "type": "YumRepository", + "id": 2 + }, + "zypper": { + "type": "ZypperRepository", + "id": 3 + }, + "goo": { + "type": "GooRepository", + "id": 4 + } + }, + "nested": { + "AptRepository": { + "fields": { + "archiveType": { + "type": "ArchiveType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "uri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "distribution": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "components": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gpgKey": { + "type": "string", + "id": 5 + } + }, + "nested": { + "ArchiveType": { + "values": { + "ARCHIVE_TYPE_UNSPECIFIED": 0, + "DEB": 1, + "DEB_SRC": 2 + } + } + } + }, + "YumRepository": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "baseUrl": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gpgKeys": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "ZypperRepository": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "baseUrl": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gpgKeys": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "GooRepository": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "url": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ExecResource": { + "fields": { + "validate": { + "type": "Exec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "enforce": { + "type": "Exec", + "id": 2 + } + }, + "nested": { + "Exec": { + "oneofs": { + "source": { + "oneof": [ + "file", + "script" + ] + } + }, + "fields": { + "file": { + "type": "File", + "id": 1 + }, + "script": { + "type": "string", + "id": 2 + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "interpreter": { + "type": "Interpreter", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputFilePath": { + "type": "string", + "id": 5 + } + }, + "nested": { + "Interpreter": { + "values": { + "INTERPRETER_UNSPECIFIED": 0, + "NONE": 1, + "SHELL": 2, + "POWERSHELL": 3 + } + } + } + } + } + }, + "FileResource": { + "oneofs": { + "source": { + "oneof": [ + "file", + "content" + ] + } + }, + "fields": { + "file": { + "type": "File", + "id": 1 + }, + "content": { + "type": "string", + "id": 2 + }, + "path": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "state": { + "type": "DesiredState", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "permissions": { + "type": "string", + "id": 5 + } + }, + "nested": { + "DesiredState": { + "values": { + "DESIRED_STATE_UNSPECIFIED": 0, + "PRESENT": 1, + "ABSENT": 2, + "CONTENTS_MATCH": 3 + } + } + } + } + } + }, + "ResourceGroup": { + "fields": { + "osFilter": { + "type": "OSFilter", + "id": 1, + "options": { + "deprecated": true + } + }, + "inventoryFilters": { + "rule": "repeated", + "type": "InventoryFilter", + "id": 3 + }, + "resources": { + "rule": "repeated", + "type": "Resource", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "GetOSPolicyAssignmentReportRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/OSPolicyAssignmentReport" + } + } + } + }, + "ListOSPolicyAssignmentReportsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/InstanceOSPolicyAssignment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListOSPolicyAssignmentReportsResponse": { + "fields": { + "osPolicyAssignmentReports": { + "rule": "repeated", + "type": "OSPolicyAssignmentReport", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "OSPolicyAssignmentReport": { + "options": { + "(google.api.resource).type": "osconfig.googleapis.com/OSPolicyAssignmentReport", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "instance": { + "type": "string", + "id": 2 + }, + "osPolicyAssignment": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "osconfig.googleapis.com/OSPolicyAssignment" + } + }, + "osPolicyCompliances": { + "rule": "repeated", + "type": "OSPolicyCompliance", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "lastRunId": { + "type": "string", + "id": 6 + } + }, + "nested": { + "OSPolicyCompliance": { + "fields": { + "osPolicyId": { + "type": "string", + "id": 1 + }, + "complianceState": { + "type": "ComplianceState", + "id": 2 + }, + "complianceStateReason": { + "type": "string", + "id": 3 + }, + "osPolicyResourceCompliances": { + "rule": "repeated", + "type": "OSPolicyResourceCompliance", + "id": 4 + } + }, + "nested": { + "ComplianceState": { + "values": { + "UNKNOWN": 0, + "COMPLIANT": 1, + "NON_COMPLIANT": 2 + } + }, + "OSPolicyResourceCompliance": { + "oneofs": { + "output": { + "oneof": [ + "execResourceOutput" + ] + } + }, + "fields": { + "osPolicyResourceId": { + "type": "string", + "id": 1 + }, + "configSteps": { + "rule": "repeated", + "type": "OSPolicyResourceConfigStep", + "id": 2 + }, + "complianceState": { + "type": "ComplianceState", + "id": 3 + }, + "complianceStateReason": { + "type": "string", + "id": 4 + }, + "execResourceOutput": { + "type": "ExecResourceOutput", + "id": 5 + } + }, + "nested": { + "OSPolicyResourceConfigStep": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "errorMessage": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "VALIDATION": 1, + "DESIRED_STATE_CHECK": 2, + "DESIRED_STATE_ENFORCEMENT": 3, + "DESIRED_STATE_CHECK_POST_ENFORCEMENT": 4 + } + } + } + }, + "ComplianceState": { + "values": { + "UNKNOWN": 0, + "COMPLIANT": 1, + "NON_COMPLIANT": 2 + } + }, + "ExecResourceOutput": { + "fields": { + "enforcementOutput": { + "type": "bytes", + "id": 2 + } + } + } + } + } + } + } + } + }, + "OSPolicyAssignment": { + "options": { + "(google.api.resource).type": "osconfig.googleapis.com/OSPolicyAssignment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "osPolicies": { + "rule": "repeated", + "type": "OSPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceFilter": { + "type": "InstanceFilter", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rollout": { + "type": "Rollout", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "revisionId": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 8 + }, + "rolloutState": { + "type": "RolloutState", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "baseline": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleted": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LabelSet": { + "fields": { + "labels": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + }, + "InstanceFilter": { + "fields": { + "all": { + "type": "bool", + "id": 1 + }, + "osShortNames": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "inclusionLabels": { + "rule": "repeated", + "type": "LabelSet", + "id": 3 + }, + "exclusionLabels": { + "rule": "repeated", + "type": "LabelSet", + "id": 4 + }, + "inventories": { + "rule": "repeated", + "type": "Inventory", + "id": 5 + } + }, + "nested": { + "Inventory": { + "fields": { + "osShortName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "osVersion": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Rollout": { + "fields": { + "disruptionBudget": { + "type": "FixedOrPercent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "minWaitDuration": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RolloutState": { + "values": { + "ROLLOUT_STATE_UNSPECIFIED": 0, + "IN_PROGRESS": 1, + "CANCELLING": 2, + "CANCELLED": 3, + "SUCCEEDED": 4 + } + } + } + }, + "OSPolicyAssignmentOperationMetadata": { + "fields": { + "osPolicyAssignment": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "osconfig.googleapis.com/OSPolicyAssignment" + } + }, + "apiMethod": { + "type": "APIMethod", + "id": 2 + }, + "rolloutState": { + "type": "RolloutState", + "id": 3 + }, + "rolloutStartTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "rolloutUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + }, + "nested": { + "APIMethod": { + "values": { + "API_METHOD_UNSPECIFIED": 0, + "CREATE": 1, + "UPDATE": 2, + "DELETE": 3 + } + }, + "RolloutState": { + "values": { + "ROLLOUT_STATE_UNSPECIFIED": 0, + "IN_PROGRESS": 1, + "CANCELLING": 2, + "CANCELLED": 3, + "SUCCEEDED": 4 + } + } + } + }, + "CreateOSPolicyAssignmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "osPolicyAssignment": { + "type": "OSPolicyAssignment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "osPolicyAssignmentId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateOSPolicyAssignmentRequest": { + "fields": { + "osPolicyAssignment": { + "type": "OSPolicyAssignment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetOSPolicyAssignmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/OSPolicyAssignment" + } + } + } + }, + "ListOSPolicyAssignmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOSPolicyAssignmentsResponse": { + "fields": { + "osPolicyAssignments": { + "rule": "repeated", + "type": "OSPolicyAssignment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListOSPolicyAssignmentRevisionsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/OSPolicyAssignment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOSPolicyAssignmentRevisionsResponse": { + "fields": { + "osPolicyAssignments": { + "rule": "repeated", + "type": "OSPolicyAssignment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteOSPolicyAssignmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/OSPolicyAssignment" + } + } + } + }, + "FixedOrPercent": { + "oneofs": { + "mode": { + "oneof": [ + "fixed", + "percent" + ] + } + }, + "fields": { + "fixed": { + "type": "int32", + "id": 1 + }, + "percent": { + "type": "int32", + "id": 2 + } + } + }, + "OsConfigZonalService": { + "options": { + "(google.api.default_host)": "osconfig.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateOSPolicyAssignment": { + "requestType": "CreateOSPolicyAssignmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/osPolicyAssignments", + "(google.api.http).body": "os_policy_assignment", + "(google.api.method_signature)": "parent,os_policy_assignment,os_policy_assignment_id", + "(google.longrunning.operation_info).response_type": "OSPolicyAssignment", + "(google.longrunning.operation_info).metadata_type": "OSPolicyAssignmentOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*}/osPolicyAssignments", + "body": "os_policy_assignment" + } + }, + { + "(google.api.method_signature)": "parent,os_policy_assignment,os_policy_assignment_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "OSPolicyAssignment", + "metadata_type": "OSPolicyAssignmentOperationMetadata" + } + } + ] + }, + "UpdateOSPolicyAssignment": { + "requestType": "UpdateOSPolicyAssignmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1alpha/{os_policy_assignment.name=projects/*/locations/*/osPolicyAssignments/*}", + "(google.api.http).body": "os_policy_assignment", + "(google.api.method_signature)": "os_policy_assignment,update_mask", + "(google.longrunning.operation_info).response_type": "OSPolicyAssignment", + "(google.longrunning.operation_info).metadata_type": "OSPolicyAssignmentOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{os_policy_assignment.name=projects/*/locations/*/osPolicyAssignments/*}", + "body": "os_policy_assignment" + } + }, + { + "(google.api.method_signature)": "os_policy_assignment,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "OSPolicyAssignment", + "metadata_type": "OSPolicyAssignmentOperationMetadata" + } + } + ] + }, + "GetOSPolicyAssignment": { + "requestType": "GetOSPolicyAssignmentRequest", + "responseType": "OSPolicyAssignment", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListOSPolicyAssignments": { + "requestType": "ListOSPolicyAssignmentsRequest", + "responseType": "ListOSPolicyAssignmentsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/osPolicyAssignments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*}/osPolicyAssignments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListOSPolicyAssignmentRevisions": { + "requestType": "ListOSPolicyAssignmentRevisionsRequest", + "responseType": "ListOSPolicyAssignmentRevisionsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}:listRevisions", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}:listRevisions" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOSPolicyAssignment": { + "requestType": "DeleteOSPolicyAssignmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OSPolicyAssignmentOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OSPolicyAssignmentOperationMetadata" + } + } + ] + }, + "GetInstanceOSPoliciesCompliance": { + "requestType": "GetInstanceOSPoliciesComplianceRequest", + "responseType": "InstanceOSPoliciesCompliance", + "options": { + "deprecated": true, + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/instanceOSPoliciesCompliances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "deprecated": true + }, + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/instanceOSPoliciesCompliances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListInstanceOSPoliciesCompliances": { + "requestType": "ListInstanceOSPoliciesCompliancesRequest", + "responseType": "ListInstanceOSPoliciesCompliancesResponse", + "options": { + "deprecated": true, + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/instanceOSPoliciesCompliances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "deprecated": true + }, + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*}/instanceOSPoliciesCompliances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetOSPolicyAssignmentReport": { + "requestType": "GetOSPolicyAssignmentReportRequest", + "responseType": "OSPolicyAssignmentReport", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/instances/*/osPolicyAssignments/*/report}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/instances/*/osPolicyAssignments/*/report}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListOSPolicyAssignmentReports": { + "requestType": "ListOSPolicyAssignmentReportsRequest", + "responseType": "ListOSPolicyAssignmentReportsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/instances/*/osPolicyAssignments/*}/reports", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*/instances/*/osPolicyAssignments/*}/reports" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInventory": { + "requestType": "GetInventoryRequest", + "responseType": "Inventory", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/instances/*/inventory}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/instances/*/inventory}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListInventories": { + "requestType": "ListInventoriesRequest", + "responseType": "ListInventoriesResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/instances/*}/inventories", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*/instances/*}/inventories" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetVulnerabilityReport": { + "requestType": "GetVulnerabilityReportRequest", + "responseType": "VulnerabilityReport", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/instances/*/vulnerabilityReport}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/instances/*/vulnerabilityReport}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListVulnerabilityReports": { + "requestType": "ListVulnerabilityReportsRequest", + "responseType": "ListVulnerabilityReportsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "VulnerabilityReport": { + "options": { + "(google.api.resource).type": "osconfig.googleapis.com/VulnerabilityReport", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vulnerabilities": { + "rule": "repeated", + "type": "Vulnerability", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Vulnerability": { + "fields": { + "details": { + "type": "Details", + "id": 1 + }, + "installedInventoryItemIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "availableInventoryItemIds": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "deprecated": true + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "items": { + "rule": "repeated", + "type": "Item", + "id": 6 + } + }, + "nested": { + "Details": { + "fields": { + "cve": { + "type": "string", + "id": 1 + }, + "cvssV2Score": { + "type": "float", + "id": 2 + }, + "cvssV3": { + "type": "CVSSv3", + "id": 3 + }, + "severity": { + "type": "string", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "references": { + "rule": "repeated", + "type": "Reference", + "id": 6 + } + }, + "nested": { + "Reference": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "source": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Item": { + "fields": { + "installedInventoryItemId": { + "type": "string", + "id": 1 + }, + "availableInventoryItemId": { + "type": "string", + "id": 2 + }, + "fixedCpeUri": { + "type": "string", + "id": 3 + }, + "upstreamFix": { + "type": "string", + "id": 4 + } + } + } + } + } + } + }, + "GetVulnerabilityReportRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/VulnerabilityReport" + } + } + } + }, + "ListVulnerabilityReportsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListVulnerabilityReportsResponse": { + "fields": { + "vulnerabilityReports": { + "rule": "repeated", + "type": "VulnerabilityReport", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CVSSv3": { + "fields": { + "baseScore": { + "type": "float", + "id": 1 + }, + "exploitabilityScore": { + "type": "float", + "id": 2 + }, + "impactScore": { + "type": "float", + "id": 3 + }, + "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 + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "HttpProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "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" + }, + "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 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Empty": { + "fields": {} + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/timeofday;timeofday", + "java_multiple_files": true, + "java_outer_classname": "TimeOfDayProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + }, + "DateTime": { + "oneofs": { + "timeOffset": { + "oneof": [ + "utcOffset", + "timeZone" + ] + } + }, + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + }, + "hours": { + "type": "int32", + "id": 4 + }, + "minutes": { + "type": "int32", + "id": 5 + }, + "seconds": { + "type": "int32", + "id": 6 + }, + "nanos": { + "type": "int32", + "id": 7 + }, + "utcOffset": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "timeZone": { + "type": "TimeZone", + "id": 9 + } + } + }, + "TimeZone": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + } + } + }, + "DayOfWeek": { + "values": { + "DAY_OF_WEEK_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7 + } + }, + "TimeOfDay": { + "fields": { + "hours": { + "type": "int32", + "id": 1 + }, + "minutes": { + "type": "int32", + "id": 2 + }, + "seconds": { + "type": "int32", + "id": 3 + }, + "nanos": { + "type": "int32", + "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-osconfig/samples/README.md b/packages/google-cloud-osconfig/samples/README.md new file mode 100644 index 00000000000..04630804cd8 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/README.md @@ -0,0 +1,752 @@ +[//]: # "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 + +# [OS Config API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Os_config_service.cancel_patch_job](#os_config_service.cancel_patch_job) + * [Os_config_service.create_patch_deployment](#os_config_service.create_patch_deployment) + * [Os_config_service.delete_patch_deployment](#os_config_service.delete_patch_deployment) + * [Os_config_service.execute_patch_job](#os_config_service.execute_patch_job) + * [Os_config_service.get_patch_deployment](#os_config_service.get_patch_deployment) + * [Os_config_service.get_patch_job](#os_config_service.get_patch_job) + * [Os_config_service.list_patch_deployments](#os_config_service.list_patch_deployments) + * [Os_config_service.list_patch_job_instance_details](#os_config_service.list_patch_job_instance_details) + * [Os_config_service.list_patch_jobs](#os_config_service.list_patch_jobs) + * [Os_config_service.pause_patch_deployment](#os_config_service.pause_patch_deployment) + * [Os_config_service.resume_patch_deployment](#os_config_service.resume_patch_deployment) + * [Os_config_service.update_patch_deployment](#os_config_service.update_patch_deployment) + * [Os_config_zonal_service.create_o_s_policy_assignment](#os_config_zonal_service.create_o_s_policy_assignment) + * [Os_config_zonal_service.delete_o_s_policy_assignment](#os_config_zonal_service.delete_o_s_policy_assignment) + * [Os_config_zonal_service.get_inventory](#os_config_zonal_service.get_inventory) + * [Os_config_zonal_service.get_o_s_policy_assignment](#os_config_zonal_service.get_o_s_policy_assignment) + * [Os_config_zonal_service.get_o_s_policy_assignment_report](#os_config_zonal_service.get_o_s_policy_assignment_report) + * [Os_config_zonal_service.get_vulnerability_report](#os_config_zonal_service.get_vulnerability_report) + * [Os_config_zonal_service.list_inventories](#os_config_zonal_service.list_inventories) + * [Os_config_zonal_service.list_o_s_policy_assignment_reports](#os_config_zonal_service.list_o_s_policy_assignment_reports) + * [Os_config_zonal_service.list_o_s_policy_assignment_revisions](#os_config_zonal_service.list_o_s_policy_assignment_revisions) + * [Os_config_zonal_service.list_o_s_policy_assignments](#os_config_zonal_service.list_o_s_policy_assignments) + * [Os_config_zonal_service.list_vulnerability_reports](#os_config_zonal_service.list_vulnerability_reports) + * [Os_config_zonal_service.update_o_s_policy_assignment](#os_config_zonal_service.update_o_s_policy_assignment) + * [Os_config_zonal_service.create_o_s_policy_assignment](#os_config_zonal_service.create_o_s_policy_assignment) + * [Os_config_zonal_service.delete_o_s_policy_assignment](#os_config_zonal_service.delete_o_s_policy_assignment) + * [Os_config_zonal_service.get_instance_o_s_policies_compliance](#os_config_zonal_service.get_instance_o_s_policies_compliance) + * [Os_config_zonal_service.get_inventory](#os_config_zonal_service.get_inventory) + * [Os_config_zonal_service.get_o_s_policy_assignment](#os_config_zonal_service.get_o_s_policy_assignment) + * [Os_config_zonal_service.get_o_s_policy_assignment_report](#os_config_zonal_service.get_o_s_policy_assignment_report) + * [Os_config_zonal_service.get_vulnerability_report](#os_config_zonal_service.get_vulnerability_report) + * [Os_config_zonal_service.list_instance_o_s_policies_compliances](#os_config_zonal_service.list_instance_o_s_policies_compliances) + * [Os_config_zonal_service.list_inventories](#os_config_zonal_service.list_inventories) + * [Os_config_zonal_service.list_o_s_policy_assignment_reports](#os_config_zonal_service.list_o_s_policy_assignment_reports) + * [Os_config_zonal_service.list_o_s_policy_assignment_revisions](#os_config_zonal_service.list_o_s_policy_assignment_revisions) + * [Os_config_zonal_service.list_o_s_policy_assignments](#os_config_zonal_service.list_o_s_policy_assignments) + * [Os_config_zonal_service.list_vulnerability_reports](#os_config_zonal_service.list_vulnerability_reports) + * [Os_config_zonal_service.update_o_s_policy_assignment](#os_config_zonal_service.update_o_s_policy_assignment) + * [Quickstart](#quickstart) + * [Quickstart.test](#quickstart.test) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Os_config_service.cancel_patch_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.cancel_patch_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.cancel_patch_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_service.cancel_patch_job.js` + + +----- + + + + +### Os_config_service.create_patch_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.create_patch_deployment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.create_patch_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_service.create_patch_deployment.js` + + +----- + + + + +### Os_config_service.delete_patch_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.delete_patch_deployment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.delete_patch_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_service.delete_patch_deployment.js` + + +----- + + + + +### Os_config_service.execute_patch_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.execute_patch_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.execute_patch_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_service.execute_patch_job.js` + + +----- + + + + +### Os_config_service.get_patch_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_deployment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_deployment.js` + + +----- + + + + +### Os_config_service.get_patch_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_job.js` + + +----- + + + + +### Os_config_service.list_patch_deployments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_deployments.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_deployments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_deployments.js` + + +----- + + + + +### Os_config_service.list_patch_job_instance_details + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_job_instance_details.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_job_instance_details.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_job_instance_details.js` + + +----- + + + + +### Os_config_service.list_patch_jobs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_jobs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_jobs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_jobs.js` + + +----- + + + + +### Os_config_service.pause_patch_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.pause_patch_deployment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.pause_patch_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_service.pause_patch_deployment.js` + + +----- + + + + +### Os_config_service.resume_patch_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.resume_patch_deployment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.resume_patch_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_service.resume_patch_deployment.js` + + +----- + + + + +### Os_config_service.update_patch_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.update_patch_deployment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_service.update_patch_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_service.update_patch_deployment.js` + + +----- + + + + +### Os_config_zonal_service.create_o_s_policy_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.create_o_s_policy_assignment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.create_o_s_policy_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.create_o_s_policy_assignment.js` + + +----- + + + + +### Os_config_zonal_service.delete_o_s_policy_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.delete_o_s_policy_assignment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.delete_o_s_policy_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.delete_o_s_policy_assignment.js` + + +----- + + + + +### Os_config_zonal_service.get_inventory + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_inventory.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_inventory.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_inventory.js` + + +----- + + + + +### Os_config_zonal_service.get_o_s_policy_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment.js` + + +----- + + + + +### Os_config_zonal_service.get_o_s_policy_assignment_report + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment_report.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment_report.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment_report.js` + + +----- + + + + +### Os_config_zonal_service.get_vulnerability_report + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_vulnerability_report.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_vulnerability_report.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_vulnerability_report.js` + + +----- + + + + +### Os_config_zonal_service.list_inventories + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_inventories.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_inventories.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_inventories.js` + + +----- + + + + +### Os_config_zonal_service.list_o_s_policy_assignment_reports + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_reports.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_reports.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_reports.js` + + +----- + + + + +### Os_config_zonal_service.list_o_s_policy_assignment_revisions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_revisions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_revisions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_revisions.js` + + +----- + + + + +### Os_config_zonal_service.list_o_s_policy_assignments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignments.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignments.js` + + +----- + + + + +### Os_config_zonal_service.list_vulnerability_reports + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_vulnerability_reports.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_vulnerability_reports.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_vulnerability_reports.js` + + +----- + + + + +### Os_config_zonal_service.update_o_s_policy_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.update_o_s_policy_assignment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.update_o_s_policy_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.update_o_s_policy_assignment.js` + + +----- + + + + +### Os_config_zonal_service.create_o_s_policy_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.create_o_s_policy_assignment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.create_o_s_policy_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.create_o_s_policy_assignment.js` + + +----- + + + + +### Os_config_zonal_service.delete_o_s_policy_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.delete_o_s_policy_assignment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.delete_o_s_policy_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.delete_o_s_policy_assignment.js` + + +----- + + + + +### Os_config_zonal_service.get_instance_o_s_policies_compliance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_instance_o_s_policies_compliance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_instance_o_s_policies_compliance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_instance_o_s_policies_compliance.js` + + +----- + + + + +### Os_config_zonal_service.get_inventory + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_inventory.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_inventory.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_inventory.js` + + +----- + + + + +### Os_config_zonal_service.get_o_s_policy_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment.js` + + +----- + + + + +### Os_config_zonal_service.get_o_s_policy_assignment_report + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment_report.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment_report.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment_report.js` + + +----- + + + + +### Os_config_zonal_service.get_vulnerability_report + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_vulnerability_report.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_vulnerability_report.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_vulnerability_report.js` + + +----- + + + + +### Os_config_zonal_service.list_instance_o_s_policies_compliances + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_instance_o_s_policies_compliances.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_instance_o_s_policies_compliances.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_instance_o_s_policies_compliances.js` + + +----- + + + + +### Os_config_zonal_service.list_inventories + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_inventories.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_inventories.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_inventories.js` + + +----- + + + + +### Os_config_zonal_service.list_o_s_policy_assignment_reports + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_reports.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_reports.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_reports.js` + + +----- + + + + +### Os_config_zonal_service.list_o_s_policy_assignment_revisions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_revisions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_revisions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_revisions.js` + + +----- + + + + +### Os_config_zonal_service.list_o_s_policy_assignments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignments.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignments.js` + + +----- + + + + +### Os_config_zonal_service.list_vulnerability_reports + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_vulnerability_reports.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_vulnerability_reports.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_vulnerability_reports.js` + + +----- + + + + +### Os_config_zonal_service.update_o_s_policy_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.update_o_s_policy_assignment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.update_o_s_policy_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.update_o_s_policy_assignment.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/quickstart.js` + + +----- + + + + +### Quickstart.test + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-osconfig/samples/test/quickstart.test.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-osconfig/samples/test/quickstart.test.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-osconfig/samples/test/quickstart.test.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/compute/docs/os-patch-management diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.cancel_patch_job.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.cancel_patch_job.js new file mode 100644 index 00000000000..92ca4d1cd52 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.cancel_patch_job.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START osconfig_v1_generated_OsConfigService_CancelPatchJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 patch in the form `projects/* /patchJobs/*` + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigServiceClient(); + + async function callCancelPatchJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.cancelPatchJob(request); + console.log(response); + } + + callCancelPatchJob(); + // [END osconfig_v1_generated_OsConfigService_CancelPatchJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.create_patch_deployment.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.create_patch_deployment.js new file mode 100644 index 00000000000..7db719b045f --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.create_patch_deployment.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, patchDeploymentId, patchDeployment) { + // [START osconfig_v1_generated_OsConfigService_CreatePatchDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project to apply this patch deployment to in the form + * `projects/*`. + */ + // const parent = 'abc123' + /** + * Required. A name for the patch deployment in the project. When creating a + * name the following rules apply: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the project. + */ + // const patchDeploymentId = 'abc123' + /** + * Required. The patch deployment to create. + */ + // const patchDeployment = {} + + // Imports the Osconfig library + const {OsConfigServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigServiceClient(); + + async function callCreatePatchDeployment() { + // Construct request + const request = { + parent, + patchDeploymentId, + patchDeployment, + }; + + // Run request + const response = await osconfigClient.createPatchDeployment(request); + console.log(response); + } + + callCreatePatchDeployment(); + // [END osconfig_v1_generated_OsConfigService_CreatePatchDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.delete_patch_deployment.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.delete_patch_deployment.js new file mode 100644 index 00000000000..5e498fd843c --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.delete_patch_deployment.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 osconfig_v1_generated_OsConfigService_DeletePatchDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the patch deployment in the form + * `projects/* /patchDeployments/*`. + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigServiceClient(); + + async function callDeletePatchDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.deletePatchDeployment(request); + console.log(response); + } + + callDeletePatchDeployment(); + // [END osconfig_v1_generated_OsConfigService_DeletePatchDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.execute_patch_job.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.execute_patch_job.js new file mode 100644 index 00000000000..c28fcaecf8a --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.execute_patch_job.js @@ -0,0 +1,95 @@ +// 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, instanceFilter) { + // [START osconfig_v1_generated_OsConfigService_ExecutePatchJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project in which to run this patch in the form `projects/*` + */ + // const parent = 'abc123' + /** + * Description of the patch job. Length of the description is limited + * to 1024 characters. + */ + // const description = 'abc123' + /** + * Required. Instances to patch, either explicitly or filtered by some + * criteria such as zone or labels. + */ + // const instanceFilter = {} + /** + * Patch configuration being applied. If omitted, instances are + * patched using the default configurations. + */ + // const patchConfig = {} + /** + * Duration of the patch job. After the duration ends, the patch job + * times out. + */ + // const duration = {} + /** + * If this patch is a dry-run only, instances are contacted but + * will do nothing. + */ + // const dryRun = true + /** + * Display name for this patch job. This does not have to be unique. + */ + // const displayName = 'abc123' + /** + * Rollout strategy of the patch job. + */ + // const rollout = {} + + // Imports the Osconfig library + const {OsConfigServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigServiceClient(); + + async function callExecutePatchJob() { + // Construct request + const request = { + parent, + instanceFilter, + }; + + // Run request + const response = await osconfigClient.executePatchJob(request); + console.log(response); + } + + callExecutePatchJob(); + // [END osconfig_v1_generated_OsConfigService_ExecutePatchJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_deployment.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_deployment.js new file mode 100644 index 00000000000..a6f5ffa6621 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_deployment.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 osconfig_v1_generated_OsConfigService_GetPatchDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the patch deployment in the form + * `projects/* /patchDeployments/*`. + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigServiceClient(); + + async function callGetPatchDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.getPatchDeployment(request); + console.log(response); + } + + callGetPatchDeployment(); + // [END osconfig_v1_generated_OsConfigService_GetPatchDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_job.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_job.js new file mode 100644 index 00000000000..ed0fb711da5 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.get_patch_job.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START osconfig_v1_generated_OsConfigService_GetPatchJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 patch in the form `projects/* /patchJobs/*` + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigServiceClient(); + + async function callGetPatchJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.getPatchJob(request); + console.log(response); + } + + callGetPatchJob(); + // [END osconfig_v1_generated_OsConfigService_GetPatchJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_deployments.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_deployments.js new file mode 100644 index 00000000000..2682958ceff --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_deployments.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(parent) { + // [START osconfig_v1_generated_OsConfigService_ListPatchDeployments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent in the form `projects/*`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of patch deployments to return. Default is + * 100. + */ + // const pageSize = 1234 + /** + * Optional. A pagination token returned from a previous call to + * ListPatchDeployments that indicates where this listing should continue + * from. + */ + // const pageToken = 'abc123' + + // Imports the Osconfig library + const {OsConfigServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigServiceClient(); + + async function callListPatchDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await osconfigClient.listPatchDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPatchDeployments(); + // [END osconfig_v1_generated_OsConfigService_ListPatchDeployments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_job_instance_details.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_job_instance_details.js new file mode 100644 index 00000000000..323f318f28d --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_job_instance_details.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 osconfig_v1_generated_OsConfigService_ListPatchJobInstanceDetails_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 for the instances are in the form of + * `projects/* /patchJobs/*`. + */ + // const parent = 'abc123' + /** + * The maximum number of instance details records to return. Default is 100. + */ + // const pageSize = 1234 + /** + * A pagination token returned from a previous call + * that indicates where this listing should continue from. + */ + // const pageToken = 'abc123' + /** + * A filter expression that filters results listed in the response. This + * field supports filtering results by instance zone, name, state, or + * `failure_reason`. + */ + // const filter = 'abc123' + + // Imports the Osconfig library + const {OsConfigServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigServiceClient(); + + async function callListPatchJobInstanceDetails() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await osconfigClient.listPatchJobInstanceDetailsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPatchJobInstanceDetails(); + // [END osconfig_v1_generated_OsConfigService_ListPatchJobInstanceDetails_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_jobs.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_jobs.js new file mode 100644 index 00000000000..0828a3bcea9 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.list_patch_jobs.js @@ -0,0 +1,78 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START osconfig_v1_generated_OsConfigService_ListPatchJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. In the form of `projects/*` + */ + // const parent = 'abc123' + /** + * The maximum number of instance status to return. + */ + // const pageSize = 1234 + /** + * A pagination token returned from a previous call + * that indicates where this listing should continue from. + */ + // const pageToken = 'abc123' + /** + * If provided, this field specifies the criteria that must be met by patch + * jobs to be included in the response. + * Currently, filtering is only available on the patch_deployment field. + */ + // const filter = 'abc123' + + // Imports the Osconfig library + const {OsConfigServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigServiceClient(); + + async function callListPatchJobs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await osconfigClient.listPatchJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPatchJobs(); + // [END osconfig_v1_generated_OsConfigService_ListPatchJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.pause_patch_deployment.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.pause_patch_deployment.js new file mode 100644 index 00000000000..9ed79eb8b0e --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.pause_patch_deployment.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 osconfig_v1_generated_OsConfigService_PausePatchDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the patch deployment in the form + * `projects/* /patchDeployments/*`. + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigServiceClient(); + + async function callPausePatchDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.pausePatchDeployment(request); + console.log(response); + } + + callPausePatchDeployment(); + // [END osconfig_v1_generated_OsConfigService_PausePatchDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.resume_patch_deployment.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.resume_patch_deployment.js new file mode 100644 index 00000000000..a0ecdc6b35b --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.resume_patch_deployment.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 osconfig_v1_generated_OsConfigService_ResumePatchDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the patch deployment in the form + * `projects/* /patchDeployments/*`. + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigServiceClient(); + + async function callResumePatchDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.resumePatchDeployment(request); + console.log(response); + } + + callResumePatchDeployment(); + // [END osconfig_v1_generated_OsConfigService_ResumePatchDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.update_patch_deployment.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.update_patch_deployment.js new file mode 100644 index 00000000000..322f01540ae --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_service.update_patch_deployment.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(patchDeployment) { + // [START osconfig_v1_generated_OsConfigService_UpdatePatchDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The patch deployment to Update. + */ + // const patchDeployment = {} + /** + * Optional. Field mask that controls which fields of the patch deployment + * should be updated. + */ + // const updateMask = {} + + // Imports the Osconfig library + const {OsConfigServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigServiceClient(); + + async function callUpdatePatchDeployment() { + // Construct request + const request = { + patchDeployment, + }; + + // Run request + const response = await osconfigClient.updatePatchDeployment(request); + console.log(response); + } + + callUpdatePatchDeployment(); + // [END osconfig_v1_generated_OsConfigService_UpdatePatchDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.create_o_s_policy_assignment.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.create_o_s_policy_assignment.js new file mode 100644 index 00000000000..d88a8993a18 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.create_o_s_policy_assignment.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, osPolicyAssignment, osPolicyAssignmentId) { + // [START osconfig_v1_generated_OsConfigZonalService_CreateOSPolicyAssignment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name in the form: + * projects/{project}/locations/{location} + */ + // const parent = 'abc123' + /** + * Required. The OS policy assignment to be created. + */ + // const osPolicyAssignment = {} + /** + * Required. The logical name of the OS policy assignment in the project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the project. + */ + // const osPolicyAssignmentId = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callCreateOSPolicyAssignment() { + // Construct request + const request = { + parent, + osPolicyAssignment, + osPolicyAssignmentId, + }; + + // Run request + const [operation] = await osconfigClient.createOSPolicyAssignment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateOSPolicyAssignment(); + // [END osconfig_v1_generated_OsConfigZonalService_CreateOSPolicyAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.delete_o_s_policy_assignment.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.delete_o_s_policy_assignment.js new file mode 100644 index 00000000000..42bfbb420e5 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.delete_o_s_policy_assignment.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 osconfig_v1_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the OS policy assignment to be deleted + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callDeleteOSPolicyAssignment() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await osconfigClient.deleteOSPolicyAssignment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteOSPolicyAssignment(); + // [END osconfig_v1_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_inventory.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_inventory.js new file mode 100644 index 00000000000..5f00647e6c5 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_inventory.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) { + // [START osconfig_v1_generated_OsConfigZonalService_GetInventory_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. API resource name for inventory resource. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/inventory` + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either Compute Engine `instance-id` or `instance-name` + * can be provided. + */ + // const name = 'abc123' + /** + * Inventory view indicating what information should be included in the + * inventory resource. If unspecified, the default view is BASIC. + */ + // const view = {} + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callGetInventory() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.getInventory(request); + console.log(response); + } + + callGetInventory(); + // [END osconfig_v1_generated_OsConfigZonalService_GetInventory_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment.js new file mode 100644 index 00000000000..93cb840f438 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of OS policy assignment. + * Format: + * `projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}@{revisionId}` + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callGetOSPolicyAssignment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.getOSPolicyAssignment(request); + console.log(response); + } + + callGetOSPolicyAssignment(); + // [END osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment_report.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment_report.js new file mode 100644 index 00000000000..b63c6f53ae5 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_o_s_policy_assignment_report.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(name) { + // [START osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. API resource name for OS policy assignment report. + * Format: + * `/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report` + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance_id}`, either Compute Engine `instance-id` or `instance-name` + * can be provided. + * For `{assignment_id}`, the OSPolicyAssignment id must be provided. + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callGetOSPolicyAssignmentReport() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.getOSPolicyAssignmentReport(request); + console.log(response); + } + + callGetOSPolicyAssignmentReport(); + // [END osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_vulnerability_report.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_vulnerability_report.js new file mode 100644 index 00000000000..be6b5621419 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.get_vulnerability_report.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(name) { + // [START osconfig_v1_generated_OsConfigZonalService_GetVulnerabilityReport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. API resource name for vulnerability resource. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either Compute Engine `instance-id` or `instance-name` + * can be provided. + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callGetVulnerabilityReport() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.getVulnerabilityReport(request); + console.log(response); + } + + callGetVulnerabilityReport(); + // [END osconfig_v1_generated_OsConfigZonalService_GetVulnerabilityReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_inventories.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_inventories.js new file mode 100644 index 00000000000..81e7b974c01 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_inventories.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START osconfig_v1_generated_OsConfigZonalService_ListInventories_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. + * Format: `projects/{project}/locations/{location}/instances/-` + * For `{project}`, either `project-number` or `project-id` can be provided. + */ + // const parent = 'abc123' + /** + * Inventory view indicating what information should be included in the + * inventory resource. If unspecified, the default view is BASIC. + */ + // const view = {} + /** + * The maximum number of results to return. + */ + // const pageSize = 1234 + /** + * A pagination token returned from a previous call to + * `ListInventories` that indicates where this listing + * should continue from. + */ + // const pageToken = 'abc123' + /** + * If provided, this field specifies the criteria that must be met by a + * `Inventory` API resource to be included in the response. + */ + // const filter = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callListInventories() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await osconfigClient.listInventoriesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInventories(); + // [END osconfig_v1_generated_OsConfigZonalService_ListInventories_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_reports.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_reports.js new file mode 100644 index 00000000000..c97380a4e46 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_reports.js @@ -0,0 +1,95 @@ +// 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 osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + * provided. If '-' is provided, the response will include + * OSPolicyAssignmentReports for all instances in the project/location. + * For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + * is provided, the response will include OSPolicyAssignmentReports for all + * OSPolicyAssignments in the project/location. + * Either {instance} or {assignment} must be `-`. + * For example: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + * returns all reports for the instance + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + * returns all the reports for the given assignment across all instances. + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + * returns all the reports for all assignments across all instances. + */ + // const parent = 'abc123' + /** + * The maximum number of results to return. + */ + // const pageSize = 1234 + /** + * If provided, this field specifies the criteria that must be met by the + * `OSPolicyAssignmentReport` API resource that is included in the response. + */ + // const filter = 'abc123' + /** + * A pagination token returned from a previous call to the + * `ListOSPolicyAssignmentReports` method that indicates where this listing + * should continue from. + */ + // const pageToken = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callListOSPolicyAssignmentReports() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await osconfigClient.listOSPolicyAssignmentReportsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListOSPolicyAssignmentReports(); + // [END osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_revisions.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_revisions.js new file mode 100644 index 00000000000..ad00726b4e4 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignment_revisions.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(name) { + // [START osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the OS policy assignment to list revisions for. + */ + // const name = 'abc123' + /** + * The maximum number of revisions to return. + */ + // const pageSize = 1234 + /** + * A pagination token returned from a previous call to + * `ListOSPolicyAssignmentRevisions` that indicates where this listing should + * continue from. + */ + // const pageToken = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callListOSPolicyAssignmentRevisions() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await osconfigClient.listOSPolicyAssignmentRevisionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListOSPolicyAssignmentRevisions(); + // [END osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignments.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignments.js new file mode 100644 index 00000000000..264a2b20fc9 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_o_s_policy_assignments.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) { + // [START osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. + */ + // const parent = 'abc123' + /** + * The maximum number of assignments to return. + */ + // const pageSize = 1234 + /** + * A pagination token returned from a previous call to + * `ListOSPolicyAssignments` that indicates where this listing should continue + * from. + */ + // const pageToken = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callListOSPolicyAssignments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await osconfigClient.listOSPolicyAssignmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListOSPolicyAssignments(); + // [END osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_vulnerability_reports.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_vulnerability_reports.js new file mode 100644 index 00000000000..a4d76c8dfa2 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.list_vulnerability_reports.js @@ -0,0 +1,80 @@ +// 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 osconfig_v1_generated_OsConfigZonalService_ListVulnerabilityReports_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. + * Format: `projects/{project}/locations/{location}/instances/-` + * For `{project}`, either `project-number` or `project-id` can be provided. + */ + // const parent = 'abc123' + /** + * The maximum number of results to return. + */ + // const pageSize = 1234 + /** + * A pagination token returned from a previous call to + * `ListVulnerabilityReports` that indicates where this listing + * should continue from. + */ + // const pageToken = 'abc123' + /** + * If provided, this field specifies the criteria that must be met by a + * `vulnerabilityReport` API resource to be included in the response. + */ + // const filter = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callListVulnerabilityReports() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await osconfigClient.listVulnerabilityReportsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListVulnerabilityReports(); + // [END osconfig_v1_generated_OsConfigZonalService_ListVulnerabilityReports_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.update_o_s_policy_assignment.js b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.update_o_s_policy_assignment.js new file mode 100644 index 00000000000..8df58285ae0 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/os_config_zonal_service.update_o_s_policy_assignment.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(osPolicyAssignment) { + // [START osconfig_v1_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The updated OS policy assignment. + */ + // const osPolicyAssignment = {} + /** + * Optional. Field mask that controls which fields of the assignment should be + * updated. + */ + // const updateMask = {} + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callUpdateOSPolicyAssignment() { + // Construct request + const request = { + osPolicyAssignment, + }; + + // Run request + const [operation] = await osconfigClient.updateOSPolicyAssignment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateOSPolicyAssignment(); + // [END osconfig_v1_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1/snippet_metadata.google.cloud.osconfig.v1.json b/packages/google-cloud-osconfig/samples/generated/v1/snippet_metadata.google.cloud.osconfig.v1.json new file mode 100644 index 00000000000..b6f90a2660f --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1/snippet_metadata.google.cloud.osconfig.v1.json @@ -0,0 +1,1119 @@ +{ + "clientLibrary": { + "name": "nodejs-osconfig", + "version": "2.1.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.osconfig.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "osconfig_v1_generated_OsConfigService_ExecutePatchJob_async", + "title": "OsConfigServiceClient executePatchJob Sample", + "origin": "API_DEFINITION", + "description": " Patch VM instances by creating and running a patch job.", + "canonical": true, + "file": "os_config_service.execute_patch_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExecutePatchJob", + "fullName": "google.cloud.osconfig.v1.OsConfigService.ExecutePatchJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "description", + "type": "TYPE_STRING" + }, + { + "name": "instance_filter", + "type": ".google.cloud.osconfig.v1.PatchInstanceFilter" + }, + { + "name": "patch_config", + "type": ".google.cloud.osconfig.v1.PatchConfig" + }, + { + "name": "duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "dry_run", + "type": "TYPE_BOOL" + }, + { + "name": "display_name", + "type": "TYPE_STRING" + }, + { + "name": "rollout", + "type": ".google.cloud.osconfig.v1.PatchRollout" + } + ], + "resultType": ".google.cloud.osconfig.v1.PatchJob", + "client": { + "shortName": "OsConfigServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigServiceClient" + }, + "method": { + "shortName": "ExecutePatchJob", + "fullName": "google.cloud.osconfig.v1.OsConfigService.ExecutePatchJob", + "service": { + "shortName": "OsConfigService", + "fullName": "google.cloud.osconfig.v1.OsConfigService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigService_GetPatchJob_async", + "title": "OsConfigServiceClient getPatchJob Sample", + "origin": "API_DEFINITION", + "description": " Get the patch job. This can be used to track the progress of an ongoing patch job or review the details of completed jobs.", + "canonical": true, + "file": "os_config_service.get_patch_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPatchJob", + "fullName": "google.cloud.osconfig.v1.OsConfigService.GetPatchJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.PatchJob", + "client": { + "shortName": "OsConfigServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigServiceClient" + }, + "method": { + "shortName": "GetPatchJob", + "fullName": "google.cloud.osconfig.v1.OsConfigService.GetPatchJob", + "service": { + "shortName": "OsConfigService", + "fullName": "google.cloud.osconfig.v1.OsConfigService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigService_CancelPatchJob_async", + "title": "OsConfigServiceClient cancelPatchJob Sample", + "origin": "API_DEFINITION", + "description": " Cancel a patch job. The patch job must be active. Canceled patch jobs cannot be restarted.", + "canonical": true, + "file": "os_config_service.cancel_patch_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelPatchJob", + "fullName": "google.cloud.osconfig.v1.OsConfigService.CancelPatchJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.PatchJob", + "client": { + "shortName": "OsConfigServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigServiceClient" + }, + "method": { + "shortName": "CancelPatchJob", + "fullName": "google.cloud.osconfig.v1.OsConfigService.CancelPatchJob", + "service": { + "shortName": "OsConfigService", + "fullName": "google.cloud.osconfig.v1.OsConfigService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigService_ListPatchJobs_async", + "title": "OsConfigServiceClient listPatchJobs Sample", + "origin": "API_DEFINITION", + "description": " Get a list of patch jobs.", + "canonical": true, + "file": "os_config_service.list_patch_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPatchJobs", + "fullName": "google.cloud.osconfig.v1.OsConfigService.ListPatchJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.ListPatchJobsResponse", + "client": { + "shortName": "OsConfigServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigServiceClient" + }, + "method": { + "shortName": "ListPatchJobs", + "fullName": "google.cloud.osconfig.v1.OsConfigService.ListPatchJobs", + "service": { + "shortName": "OsConfigService", + "fullName": "google.cloud.osconfig.v1.OsConfigService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigService_ListPatchJobInstanceDetails_async", + "title": "OsConfigServiceClient listPatchJobInstanceDetails Sample", + "origin": "API_DEFINITION", + "description": " Get a list of instance details for a given patch job.", + "canonical": true, + "file": "os_config_service.list_patch_job_instance_details.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPatchJobInstanceDetails", + "fullName": "google.cloud.osconfig.v1.OsConfigService.ListPatchJobInstanceDetails", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.ListPatchJobInstanceDetailsResponse", + "client": { + "shortName": "OsConfigServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigServiceClient" + }, + "method": { + "shortName": "ListPatchJobInstanceDetails", + "fullName": "google.cloud.osconfig.v1.OsConfigService.ListPatchJobInstanceDetails", + "service": { + "shortName": "OsConfigService", + "fullName": "google.cloud.osconfig.v1.OsConfigService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigService_CreatePatchDeployment_async", + "title": "OsConfigServiceClient createPatchDeployment Sample", + "origin": "API_DEFINITION", + "description": " Create an OS Config patch deployment.", + "canonical": true, + "file": "os_config_service.create_patch_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePatchDeployment", + "fullName": "google.cloud.osconfig.v1.OsConfigService.CreatePatchDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "patch_deployment_id", + "type": "TYPE_STRING" + }, + { + "name": "patch_deployment", + "type": ".google.cloud.osconfig.v1.PatchDeployment" + } + ], + "resultType": ".google.cloud.osconfig.v1.PatchDeployment", + "client": { + "shortName": "OsConfigServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigServiceClient" + }, + "method": { + "shortName": "CreatePatchDeployment", + "fullName": "google.cloud.osconfig.v1.OsConfigService.CreatePatchDeployment", + "service": { + "shortName": "OsConfigService", + "fullName": "google.cloud.osconfig.v1.OsConfigService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigService_GetPatchDeployment_async", + "title": "OsConfigServiceClient getPatchDeployment Sample", + "origin": "API_DEFINITION", + "description": " Get an OS Config patch deployment.", + "canonical": true, + "file": "os_config_service.get_patch_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPatchDeployment", + "fullName": "google.cloud.osconfig.v1.OsConfigService.GetPatchDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.PatchDeployment", + "client": { + "shortName": "OsConfigServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigServiceClient" + }, + "method": { + "shortName": "GetPatchDeployment", + "fullName": "google.cloud.osconfig.v1.OsConfigService.GetPatchDeployment", + "service": { + "shortName": "OsConfigService", + "fullName": "google.cloud.osconfig.v1.OsConfigService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigService_ListPatchDeployments_async", + "title": "OsConfigServiceClient listPatchDeployments Sample", + "origin": "API_DEFINITION", + "description": " Get a page of OS Config patch deployments.", + "canonical": true, + "file": "os_config_service.list_patch_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPatchDeployments", + "fullName": "google.cloud.osconfig.v1.OsConfigService.ListPatchDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.ListPatchDeploymentsResponse", + "client": { + "shortName": "OsConfigServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigServiceClient" + }, + "method": { + "shortName": "ListPatchDeployments", + "fullName": "google.cloud.osconfig.v1.OsConfigService.ListPatchDeployments", + "service": { + "shortName": "OsConfigService", + "fullName": "google.cloud.osconfig.v1.OsConfigService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigService_DeletePatchDeployment_async", + "title": "OsConfigServiceClient deletePatchDeployment Sample", + "origin": "API_DEFINITION", + "description": " Delete an OS Config patch deployment.", + "canonical": true, + "file": "os_config_service.delete_patch_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePatchDeployment", + "fullName": "google.cloud.osconfig.v1.OsConfigService.DeletePatchDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "OsConfigServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigServiceClient" + }, + "method": { + "shortName": "DeletePatchDeployment", + "fullName": "google.cloud.osconfig.v1.OsConfigService.DeletePatchDeployment", + "service": { + "shortName": "OsConfigService", + "fullName": "google.cloud.osconfig.v1.OsConfigService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigService_UpdatePatchDeployment_async", + "title": "OsConfigServiceClient updatePatchDeployment Sample", + "origin": "API_DEFINITION", + "description": " Update an OS Config patch deployment.", + "canonical": true, + "file": "os_config_service.update_patch_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdatePatchDeployment", + "fullName": "google.cloud.osconfig.v1.OsConfigService.UpdatePatchDeployment", + "async": true, + "parameters": [ + { + "name": "patch_deployment", + "type": ".google.cloud.osconfig.v1.PatchDeployment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.osconfig.v1.PatchDeployment", + "client": { + "shortName": "OsConfigServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigServiceClient" + }, + "method": { + "shortName": "UpdatePatchDeployment", + "fullName": "google.cloud.osconfig.v1.OsConfigService.UpdatePatchDeployment", + "service": { + "shortName": "OsConfigService", + "fullName": "google.cloud.osconfig.v1.OsConfigService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigService_PausePatchDeployment_async", + "title": "OsConfigServiceClient pausePatchDeployment Sample", + "origin": "API_DEFINITION", + "description": " Change state of patch deployment to \"PAUSED\". Patch deployment in paused state doesn't generate patch jobs.", + "canonical": true, + "file": "os_config_service.pause_patch_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PausePatchDeployment", + "fullName": "google.cloud.osconfig.v1.OsConfigService.PausePatchDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.PatchDeployment", + "client": { + "shortName": "OsConfigServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigServiceClient" + }, + "method": { + "shortName": "PausePatchDeployment", + "fullName": "google.cloud.osconfig.v1.OsConfigService.PausePatchDeployment", + "service": { + "shortName": "OsConfigService", + "fullName": "google.cloud.osconfig.v1.OsConfigService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigService_ResumePatchDeployment_async", + "title": "OsConfigServiceClient resumePatchDeployment Sample", + "origin": "API_DEFINITION", + "description": " Change state of patch deployment back to \"ACTIVE\". Patch deployment in active state continues to generate patch jobs.", + "canonical": true, + "file": "os_config_service.resume_patch_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResumePatchDeployment", + "fullName": "google.cloud.osconfig.v1.OsConfigService.ResumePatchDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.PatchDeployment", + "client": { + "shortName": "OsConfigServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigServiceClient" + }, + "method": { + "shortName": "ResumePatchDeployment", + "fullName": "google.cloud.osconfig.v1.OsConfigService.ResumePatchDeployment", + "service": { + "shortName": "OsConfigService", + "fullName": "google.cloud.osconfig.v1.OsConfigService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigZonalService_CreateOSPolicyAssignment_async", + "title": "OsConfigServiceClient createOSPolicyAssignment Sample", + "origin": "API_DEFINITION", + "description": " Create an OS policy assignment. This method also creates the first revision of the OS policy assignment. This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO. For more information, see [Method: projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel).", + "canonical": true, + "file": "os_config_zonal_service.create_o_s_policy_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.CreateOSPolicyAssignment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "os_policy_assignment", + "type": ".google.cloud.osconfig.v1.OSPolicyAssignment" + }, + { + "name": "os_policy_assignment_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "CreateOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.CreateOSPolicyAssignment", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async", + "title": "OsConfigServiceClient updateOSPolicyAssignment Sample", + "origin": "API_DEFINITION", + "description": " Update an existing OS policy assignment. This method creates a new revision of the OS policy assignment. This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO. For more information, see [Method: projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel).", + "canonical": true, + "file": "os_config_zonal_service.update_o_s_policy_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.UpdateOSPolicyAssignment", + "async": true, + "parameters": [ + { + "name": "os_policy_assignment", + "type": ".google.cloud.osconfig.v1.OSPolicyAssignment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "UpdateOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.UpdateOSPolicyAssignment", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignment_async", + "title": "OsConfigServiceClient getOSPolicyAssignment Sample", + "origin": "API_DEFINITION", + "description": " Retrieve an existing OS policy assignment. This method always returns the latest revision. In order to retrieve a previous revision of the assignment, also provide the revision ID in the `name` parameter.", + "canonical": true, + "file": "os_config_zonal_service.get_o_s_policy_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.GetOSPolicyAssignment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.OSPolicyAssignment", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "GetOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.GetOSPolicyAssignment", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignments_async", + "title": "OsConfigServiceClient listOSPolicyAssignments Sample", + "origin": "API_DEFINITION", + "description": " List the OS policy assignments under the parent resource. For each OS policy assignment, the latest revision is returned.", + "canonical": true, + "file": "os_config_zonal_service.list_o_s_policy_assignments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListOSPolicyAssignments", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.ListOSPolicyAssignments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "ListOSPolicyAssignments", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.ListOSPolicyAssignments", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async", + "title": "OsConfigServiceClient listOSPolicyAssignmentRevisions Sample", + "origin": "API_DEFINITION", + "description": " List the OS policy assignment revisions for a given OS policy assignment.", + "canonical": true, + "file": "os_config_zonal_service.list_o_s_policy_assignment_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListOSPolicyAssignmentRevisions", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.ListOSPolicyAssignmentRevisions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "ListOSPolicyAssignmentRevisions", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.ListOSPolicyAssignmentRevisions", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async", + "title": "OsConfigServiceClient deleteOSPolicyAssignment Sample", + "origin": "API_DEFINITION", + "description": " Delete the OS policy assignment. This method creates a new revision of the OS policy assignment. This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO. If the LRO completes and is not cancelled, all revisions associated with the OS policy assignment are deleted. For more information, see [Method: projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel).", + "canonical": true, + "file": "os_config_zonal_service.delete_o_s_policy_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.DeleteOSPolicyAssignment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "DeleteOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.DeleteOSPolicyAssignment", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async", + "title": "OsConfigServiceClient getOSPolicyAssignmentReport Sample", + "origin": "API_DEFINITION", + "description": " Get the OS policy asssignment report for the specified Compute Engine VM instance.", + "canonical": true, + "file": "os_config_zonal_service.get_o_s_policy_assignment_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOSPolicyAssignmentReport", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.GetOSPolicyAssignmentReport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.OSPolicyAssignmentReport", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "GetOSPolicyAssignmentReport", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.GetOSPolicyAssignmentReport", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async", + "title": "OsConfigServiceClient listOSPolicyAssignmentReports Sample", + "origin": "API_DEFINITION", + "description": " List OS policy asssignment reports for all Compute Engine VM instances in the specified zone.", + "canonical": true, + "file": "os_config_zonal_service.list_o_s_policy_assignment_reports.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListOSPolicyAssignmentReports", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.ListOSPolicyAssignmentReports", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "ListOSPolicyAssignmentReports", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.ListOSPolicyAssignmentReports", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigZonalService_GetInventory_async", + "title": "OsConfigServiceClient getInventory Sample", + "origin": "API_DEFINITION", + "description": " Get inventory data for the specified VM instance. If the VM has no associated inventory, the message `NOT_FOUND` is returned.", + "canonical": true, + "file": "os_config_zonal_service.get_inventory.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInventory", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.GetInventory", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.osconfig.v1.InventoryView" + } + ], + "resultType": ".google.cloud.osconfig.v1.Inventory", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "GetInventory", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.GetInventory", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListInventories_async", + "title": "OsConfigServiceClient listInventories Sample", + "origin": "API_DEFINITION", + "description": " List inventory data for all VM instances in the specified zone.", + "canonical": true, + "file": "os_config_zonal_service.list_inventories.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInventories", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.ListInventories", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.osconfig.v1.InventoryView" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.ListInventoriesResponse", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "ListInventories", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.ListInventories", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigZonalService_GetVulnerabilityReport_async", + "title": "OsConfigServiceClient getVulnerabilityReport Sample", + "origin": "API_DEFINITION", + "description": " Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have vulnerability reports associated with them.", + "canonical": true, + "file": "os_config_zonal_service.get_vulnerability_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetVulnerabilityReport", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.GetVulnerabilityReport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.VulnerabilityReport", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "GetVulnerabilityReport", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.GetVulnerabilityReport", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListVulnerabilityReports_async", + "title": "OsConfigServiceClient listVulnerabilityReports Sample", + "origin": "API_DEFINITION", + "description": " List vulnerability reports for all VM instances in the specified zone.", + "canonical": true, + "file": "os_config_zonal_service.list_vulnerability_reports.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListVulnerabilityReports", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.ListVulnerabilityReports", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1.ListVulnerabilityReportsResponse", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "ListVulnerabilityReports", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService.ListVulnerabilityReports", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1.OsConfigZonalService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.create_o_s_policy_assignment.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.create_o_s_policy_assignment.js new file mode 100644 index 00000000000..4ae773b1e39 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.create_o_s_policy_assignment.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, osPolicyAssignment, osPolicyAssignmentId) { + // [START osconfig_v1alpha_generated_OsConfigZonalService_CreateOSPolicyAssignment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name in the form: + * projects/{project}/locations/{location} + */ + // const parent = 'abc123' + /** + * Required. The OS policy assignment to be created. + */ + // const osPolicyAssignment = {} + /** + * Required. The logical name of the OS policy assignment in the project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the project. + */ + // const osPolicyAssignmentId = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callCreateOSPolicyAssignment() { + // Construct request + const request = { + parent, + osPolicyAssignment, + osPolicyAssignmentId, + }; + + // Run request + const [operation] = await osconfigClient.createOSPolicyAssignment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateOSPolicyAssignment(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_CreateOSPolicyAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.delete_o_s_policy_assignment.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.delete_o_s_policy_assignment.js new file mode 100644 index 00000000000..5fd3a000055 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.delete_o_s_policy_assignment.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 osconfig_v1alpha_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the OS policy assignment to be deleted + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callDeleteOSPolicyAssignment() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await osconfigClient.deleteOSPolicyAssignment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteOSPolicyAssignment(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_instance_o_s_policies_compliance.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_instance_o_s_policies_compliance.js new file mode 100644 index 00000000000..0c05296548e --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_instance_o_s_policies_compliance.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(name) { + // [START osconfig_v1alpha_generated_OsConfigZonalService_GetInstanceOSPoliciesCompliance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. API resource name for instance OS policies compliance resource. + * Format: + * `projects/{project}/locations/{location}/instanceOSPoliciesCompliances/{instance}` + * For `{project}`, either Compute Engine project-number or project-id can be + * provided. + * For `{instance}`, either Compute Engine VM instance-id or instance-name can + * be provided. + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callGetInstanceOSPoliciesCompliance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.getInstanceOSPoliciesCompliance(request); + console.log(response); + } + + callGetInstanceOSPoliciesCompliance(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_GetInstanceOSPoliciesCompliance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_inventory.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_inventory.js new file mode 100644 index 00000000000..900a3ee49bf --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_inventory.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) { + // [START osconfig_v1alpha_generated_OsConfigZonalService_GetInventory_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. API resource name for inventory resource. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/inventory` + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either Compute Engine `instance-id` or `instance-name` + * can be provided. + */ + // const name = 'abc123' + /** + * Inventory view indicating what information should be included in the + * inventory resource. If unspecified, the default view is BASIC. + */ + // const view = {} + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callGetInventory() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.getInventory(request); + console.log(response); + } + + callGetInventory(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_GetInventory_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment.js new file mode 100644 index 00000000000..92a47ef93ff --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of OS policy assignment. + * Format: + * `projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}@{revisionId}` + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callGetOSPolicyAssignment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.getOSPolicyAssignment(request); + console.log(response); + } + + callGetOSPolicyAssignment(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment_report.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment_report.js new file mode 100644 index 00000000000..4be13a6d374 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment_report.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(name) { + // [START osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. API resource name for OS policy assignment report. + * Format: + * `/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report` + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance_id}`, either Compute Engine `instance-id` or `instance-name` + * can be provided. + * For `{assignment_id}`, the OSPolicyAssignment id must be provided. + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callGetOSPolicyAssignmentReport() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.getOSPolicyAssignmentReport(request); + console.log(response); + } + + callGetOSPolicyAssignmentReport(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_vulnerability_report.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_vulnerability_report.js new file mode 100644 index 00000000000..ea5e979aa8e --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.get_vulnerability_report.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(name) { + // [START osconfig_v1alpha_generated_OsConfigZonalService_GetVulnerabilityReport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. API resource name for vulnerability resource. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either Compute Engine `instance-id` or `instance-name` + * can be provided. + */ + // const name = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callGetVulnerabilityReport() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osconfigClient.getVulnerabilityReport(request); + console.log(response); + } + + callGetVulnerabilityReport(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_GetVulnerabilityReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_instance_o_s_policies_compliances.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_instance_o_s_policies_compliances.js new file mode 100644 index 00000000000..15f788a9feb --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_instance_o_s_policies_compliances.js @@ -0,0 +1,81 @@ +// 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 osconfig_v1alpha_generated_OsConfigZonalService_ListInstanceOSPoliciesCompliances_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. + * Format: `projects/{project}/locations/{location}` + * For `{project}`, either Compute Engine project-number or project-id can be + * provided. + */ + // const parent = 'abc123' + /** + * The maximum number of results to return. + */ + // const pageSize = 1234 + /** + * A pagination token returned from a previous call to + * `ListInstanceOSPoliciesCompliances` that indicates where this listing + * should continue from. + */ + // const pageToken = 'abc123' + /** + * If provided, this field specifies the criteria that must be met by a + * `InstanceOSPoliciesCompliance` API resource to be included in the response. + */ + // const filter = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callListInstanceOSPoliciesCompliances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await osconfigClient.listInstanceOSPoliciesCompliancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstanceOSPoliciesCompliances(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_ListInstanceOSPoliciesCompliances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_inventories.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_inventories.js new file mode 100644 index 00000000000..d9e4e6bd71d --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_inventories.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START osconfig_v1alpha_generated_OsConfigZonalService_ListInventories_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. + * Format: `projects/{project}/locations/{location}/instances/-` + * For `{project}`, either `project-number` or `project-id` can be provided. + */ + // const parent = 'abc123' + /** + * Inventory view indicating what information should be included in the + * inventory resource. If unspecified, the default view is BASIC. + */ + // const view = {} + /** + * The maximum number of results to return. + */ + // const pageSize = 1234 + /** + * A pagination token returned from a previous call to + * `ListInventories` that indicates where this listing + * should continue from. + */ + // const pageToken = 'abc123' + /** + * If provided, this field specifies the criteria that must be met by a + * `Inventory` API resource to be included in the response. + */ + // const filter = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callListInventories() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await osconfigClient.listInventoriesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInventories(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_ListInventories_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_reports.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_reports.js new file mode 100644 index 00000000000..9cf7cfae43d --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_reports.js @@ -0,0 +1,95 @@ +// 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 osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + * provided. If '-' is provided, the response will include + * OSPolicyAssignmentReports for all instances in the project/location. + * For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + * is provided, the response will include OSPolicyAssignmentReports for all + * OSPolicyAssignments in the project/location. + * Either {instance} or {assignment} must be `-`. + * For example: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + * returns all reports for the instance + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + * returns all the reports for the given assignment across all instances. + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + * returns all the reports for all assignments across all instances. + */ + // const parent = 'abc123' + /** + * The maximum number of results to return. + */ + // const pageSize = 1234 + /** + * If provided, this field specifies the criteria that must be met by the + * `OSPolicyAssignmentReport` API resource that is included in the response. + */ + // const filter = 'abc123' + /** + * A pagination token returned from a previous call to the + * `ListOSPolicyAssignmentReports` method that indicates where this listing + * should continue from. + */ + // const pageToken = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callListOSPolicyAssignmentReports() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await osconfigClient.listOSPolicyAssignmentReportsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListOSPolicyAssignmentReports(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_revisions.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_revisions.js new file mode 100644 index 00000000000..91ae44089a6 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_revisions.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(name) { + // [START osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the OS policy assignment to list revisions for. + */ + // const name = 'abc123' + /** + * The maximum number of revisions to return. + */ + // const pageSize = 1234 + /** + * A pagination token returned from a previous call to + * `ListOSPolicyAssignmentRevisions` that indicates where this listing should + * continue from. + */ + // const pageToken = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callListOSPolicyAssignmentRevisions() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await osconfigClient.listOSPolicyAssignmentRevisionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListOSPolicyAssignmentRevisions(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignments.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignments.js new file mode 100644 index 00000000000..7f9c41542ea --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignments.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) { + // [START osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. + */ + // const parent = 'abc123' + /** + * The maximum number of assignments to return. + */ + // const pageSize = 1234 + /** + * A pagination token returned from a previous call to + * `ListOSPolicyAssignments` that indicates where this listing should continue + * from. + */ + // const pageToken = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callListOSPolicyAssignments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await osconfigClient.listOSPolicyAssignmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListOSPolicyAssignments(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_vulnerability_reports.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_vulnerability_reports.js new file mode 100644 index 00000000000..b997c9437cc --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.list_vulnerability_reports.js @@ -0,0 +1,80 @@ +// 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 osconfig_v1alpha_generated_OsConfigZonalService_ListVulnerabilityReports_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. + * Format: `projects/{project}/locations/{location}/instances/-` + * For `{project}`, either `project-number` or `project-id` can be provided. + */ + // const parent = 'abc123' + /** + * The maximum number of results to return. + */ + // const pageSize = 1234 + /** + * A pagination token returned from a previous call to + * `ListVulnerabilityReports` that indicates where this listing + * should continue from. + */ + // const pageToken = 'abc123' + /** + * If provided, this field specifies the criteria that must be met by a + * `vulnerabilityReport` API resource to be included in the response. + */ + // const filter = 'abc123' + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callListVulnerabilityReports() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await osconfigClient.listVulnerabilityReportsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListVulnerabilityReports(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_ListVulnerabilityReports_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.update_o_s_policy_assignment.js b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.update_o_s_policy_assignment.js new file mode 100644 index 00000000000..40a10f60a23 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/os_config_zonal_service.update_o_s_policy_assignment.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(osPolicyAssignment) { + // [START osconfig_v1alpha_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The updated OS policy assignment. + */ + // const osPolicyAssignment = {} + /** + * Optional. Field mask that controls which fields of the assignment should be updated. + */ + // const updateMask = {} + + // Imports the Osconfig library + const {OsConfigZonalServiceClient} = require('@google-cloud/os-config').v1alpha; + + // Instantiates a client + const osconfigClient = new OsConfigZonalServiceClient(); + + async function callUpdateOSPolicyAssignment() { + // Construct request + const request = { + osPolicyAssignment, + }; + + // Run request + const [operation] = await osconfigClient.updateOSPolicyAssignment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateOSPolicyAssignment(); + // [END osconfig_v1alpha_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-osconfig/samples/generated/v1alpha/snippet_metadata.google.cloud.osconfig.v1alpha.json b/packages/google-cloud-osconfig/samples/generated/v1alpha/snippet_metadata.google.cloud.osconfig.v1alpha.json new file mode 100644 index 00000000000..5d6895a0e76 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/generated/v1alpha/snippet_metadata.google.cloud.osconfig.v1alpha.json @@ -0,0 +1,659 @@ +{ + "clientLibrary": { + "name": "nodejs-osconfig", + "version": "2.1.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.osconfig.v1alpha", + "version": "v1alpha" + } + ] + }, + "snippets": [ + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_CreateOSPolicyAssignment_async", + "title": "OsConfigZonalService createOSPolicyAssignment Sample", + "origin": "API_DEFINITION", + "description": " Create an OS policy assignment. This method also creates the first revision of the OS policy assignment. This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO. For more information, see [Method: projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel).", + "canonical": true, + "file": "os_config_zonal_service.create_o_s_policy_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.CreateOSPolicyAssignment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "os_policy_assignment", + "type": ".google.cloud.osconfig.v1alpha.OSPolicyAssignment" + }, + { + "name": "os_policy_assignment_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "CreateOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.CreateOSPolicyAssignment", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async", + "title": "OsConfigZonalService updateOSPolicyAssignment Sample", + "origin": "API_DEFINITION", + "description": " Update an existing OS policy assignment. This method creates a new revision of the OS policy assignment. This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO. For more information, see [Method: projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel).", + "canonical": true, + "file": "os_config_zonal_service.update_o_s_policy_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.UpdateOSPolicyAssignment", + "async": true, + "parameters": [ + { + "name": "os_policy_assignment", + "type": ".google.cloud.osconfig.v1alpha.OSPolicyAssignment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "UpdateOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.UpdateOSPolicyAssignment", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignment_async", + "title": "OsConfigZonalService getOSPolicyAssignment Sample", + "origin": "API_DEFINITION", + "description": " Retrieve an existing OS policy assignment. This method always returns the latest revision. In order to retrieve a previous revision of the assignment, also provide the revision ID in the `name` parameter.", + "canonical": true, + "file": "os_config_zonal_service.get_o_s_policy_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.GetOSPolicyAssignment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1alpha.OSPolicyAssignment", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "GetOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.GetOSPolicyAssignment", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignments_async", + "title": "OsConfigZonalService listOSPolicyAssignments Sample", + "origin": "API_DEFINITION", + "description": " List the OS policy assignments under the parent resource. For each OS policy assignment, the latest revision is returned.", + "canonical": true, + "file": "os_config_zonal_service.list_o_s_policy_assignments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListOSPolicyAssignments", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.ListOSPolicyAssignments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsResponse", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "ListOSPolicyAssignments", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.ListOSPolicyAssignments", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async", + "title": "OsConfigZonalService listOSPolicyAssignmentRevisions Sample", + "origin": "API_DEFINITION", + "description": " List the OS policy assignment revisions for a given OS policy assignment.", + "canonical": true, + "file": "os_config_zonal_service.list_o_s_policy_assignment_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListOSPolicyAssignmentRevisions", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.ListOSPolicyAssignmentRevisions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsResponse", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "ListOSPolicyAssignmentRevisions", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.ListOSPolicyAssignmentRevisions", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async", + "title": "OsConfigZonalService deleteOSPolicyAssignment Sample", + "origin": "API_DEFINITION", + "description": " Delete the OS policy assignment. This method creates a new revision of the OS policy assignment. This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO. If the LRO completes and is not cancelled, all revisions associated with the OS policy assignment are deleted. For more information, see [Method: projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel).", + "canonical": true, + "file": "os_config_zonal_service.delete_o_s_policy_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.DeleteOSPolicyAssignment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "DeleteOSPolicyAssignment", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.DeleteOSPolicyAssignment", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetInstanceOSPoliciesCompliance_async", + "title": "OsConfigZonalService getInstanceOSPoliciesCompliance Sample", + "origin": "API_DEFINITION", + "description": " Get OS policies compliance data for the specified Compute Engine VM instance.", + "canonical": true, + "file": "os_config_zonal_service.get_instance_o_s_policies_compliance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstanceOSPoliciesCompliance", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.GetInstanceOSPoliciesCompliance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "GetInstanceOSPoliciesCompliance", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.GetInstanceOSPoliciesCompliance", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListInstanceOSPoliciesCompliances_async", + "title": "OsConfigZonalService listInstanceOSPoliciesCompliances Sample", + "origin": "API_DEFINITION", + "description": " List OS policies compliance data for all Compute Engine VM instances in the specified zone.", + "canonical": true, + "file": "os_config_zonal_service.list_instance_o_s_policies_compliances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstanceOSPoliciesCompliances", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.ListInstanceOSPoliciesCompliances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesResponse", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "ListInstanceOSPoliciesCompliances", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.ListInstanceOSPoliciesCompliances", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async", + "title": "OsConfigZonalService getOSPolicyAssignmentReport Sample", + "origin": "API_DEFINITION", + "description": " Get the OS policy asssignment report for the specified Compute Engine VM instance.", + "canonical": true, + "file": "os_config_zonal_service.get_o_s_policy_assignment_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOSPolicyAssignmentReport", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.GetOSPolicyAssignmentReport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "GetOSPolicyAssignmentReport", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.GetOSPolicyAssignmentReport", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async", + "title": "OsConfigZonalService listOSPolicyAssignmentReports Sample", + "origin": "API_DEFINITION", + "description": " List OS policy asssignment reports for all Compute Engine VM instances in the specified zone.", + "canonical": true, + "file": "os_config_zonal_service.list_o_s_policy_assignment_reports.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListOSPolicyAssignmentReports", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.ListOSPolicyAssignmentReports", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsResponse", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "ListOSPolicyAssignmentReports", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.ListOSPolicyAssignmentReports", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetInventory_async", + "title": "OsConfigZonalService getInventory Sample", + "origin": "API_DEFINITION", + "description": " Get inventory data for the specified VM instance. If the VM has no associated inventory, the message `NOT_FOUND` is returned.", + "canonical": true, + "file": "os_config_zonal_service.get_inventory.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInventory", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.GetInventory", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.osconfig.v1alpha.InventoryView" + } + ], + "resultType": ".google.cloud.osconfig.v1alpha.Inventory", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "GetInventory", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.GetInventory", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListInventories_async", + "title": "OsConfigZonalService listInventories Sample", + "origin": "API_DEFINITION", + "description": " List inventory data for all VM instances in the specified zone.", + "canonical": true, + "file": "os_config_zonal_service.list_inventories.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInventories", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.ListInventories", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.osconfig.v1alpha.InventoryView" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1alpha.ListInventoriesResponse", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "ListInventories", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.ListInventories", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetVulnerabilityReport_async", + "title": "OsConfigZonalService getVulnerabilityReport Sample", + "origin": "API_DEFINITION", + "description": " Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have vulnerability reports associated with them.", + "canonical": true, + "file": "os_config_zonal_service.get_vulnerability_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetVulnerabilityReport", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.GetVulnerabilityReport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1alpha.VulnerabilityReport", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "GetVulnerabilityReport", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.GetVulnerabilityReport", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + }, + { + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListVulnerabilityReports_async", + "title": "OsConfigZonalService listVulnerabilityReports Sample", + "origin": "API_DEFINITION", + "description": " List vulnerability reports for all VM instances in the specified zone.", + "canonical": true, + "file": "os_config_zonal_service.list_vulnerability_reports.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListVulnerabilityReports", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.ListVulnerabilityReports", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.osconfig.v1alpha.ListVulnerabilityReportsResponse", + "client": { + "shortName": "OsConfigZonalServiceClient", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalServiceClient" + }, + "method": { + "shortName": "ListVulnerabilityReports", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService.ListVulnerabilityReports", + "service": { + "shortName": "OsConfigZonalService", + "fullName": "google.cloud.osconfig.v1alpha.OsConfigZonalService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-osconfig/samples/package.json b/packages/google-cloud-osconfig/samples/package.json new file mode 100644 index 00000000000..885c2f2189f --- /dev/null +++ b/packages/google-cloud-osconfig/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-os-config", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/os-config": "^2.1.2" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-osconfig/samples/quickstart.js b/packages/google-cloud-osconfig/samples/quickstart.js new file mode 100644 index 00000000000..651e8f37413 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/quickstart.js @@ -0,0 +1,46 @@ +// 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. +// + +'use strict'; + +async function quickstart( + project = 'my-project' // Project to list deployments for. +) { + // [START os_config_quickstart] + // Imports the Google Cloud client library + const {OsConfigServiceClient} = require('@google-cloud/os-config'); + + // Creates a client + const client = new OsConfigServiceClient(); + + // project = 'my-project' // Project to list deployments for. + + async function listPatchDeployments() { + const [deployments] = await client.listPatchDeployments({ + parent: `projects/${project}`, + }); + console.info(`found ${deployments.length} deployments:`); + console.info(deployments); + } + const listPatchDeploymentsResponse = listPatchDeployments(); + // [END os_config_quickstart] + return listPatchDeploymentsResponse; +} + +const args = process.argv.slice(2); +quickstart(...args).catch(err => { + console.error(err); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-osconfig/samples/test/quickstart.test.js b/packages/google-cloud-osconfig/samples/test/quickstart.test.js new file mode 100644 index 00000000000..2bfec0412d6 --- /dev/null +++ b/packages/google-cloud-osconfig/samples/test/quickstart.test.js @@ -0,0 +1,39 @@ +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +const path = require('path'); +const {assert} = require('chai'); +const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +const {OsConfigServiceClient} = require('@google-cloud/os-config'); +const client = new OsConfigServiceClient(); +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + let projectId; + before(async () => { + projectId = await client.getProjectId(); + }); + it('should run quickstart', async () => { + const stdout = execSync(`node ./quickstart.js ${projectId}`, {cwd}); + assert.match(stdout, /found [0-9]+ deployments/); + }); +}); diff --git a/packages/google-cloud-osconfig/src/index.ts b/packages/google-cloud-osconfig/src/index.ts new file mode 100644 index 00000000000..5548a6b5f89 --- /dev/null +++ b/packages/google-cloud-osconfig/src/index.ts @@ -0,0 +1,30 @@ +// 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +import * as v1alpha from './v1alpha'; + +const OsConfigServiceClient = v1.OsConfigServiceClient; +type OsConfigServiceClient = v1.OsConfigServiceClient; +const OsConfigZonalServiceClient = v1.OsConfigZonalServiceClient; +type OsConfigZonalServiceClient = v1.OsConfigZonalServiceClient; + +export {v1, v1alpha, OsConfigServiceClient, OsConfigZonalServiceClient}; +export default {v1, v1alpha, OsConfigServiceClient, OsConfigZonalServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-osconfig/src/v1/gapic_metadata.json b/packages/google-cloud-osconfig/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..f65f75e1fb0 --- /dev/null +++ b/packages/google-cloud-osconfig/src/v1/gapic_metadata.json @@ -0,0 +1,309 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.osconfig.v1", + "libraryPackage": "@google-cloud/os-config", + "services": { + "OsConfigService": { + "clients": { + "grpc": { + "libraryClient": "OsConfigServiceClient", + "rpcs": { + "ExecutePatchJob": { + "methods": [ + "executePatchJob" + ] + }, + "GetPatchJob": { + "methods": [ + "getPatchJob" + ] + }, + "CancelPatchJob": { + "methods": [ + "cancelPatchJob" + ] + }, + "CreatePatchDeployment": { + "methods": [ + "createPatchDeployment" + ] + }, + "GetPatchDeployment": { + "methods": [ + "getPatchDeployment" + ] + }, + "DeletePatchDeployment": { + "methods": [ + "deletePatchDeployment" + ] + }, + "UpdatePatchDeployment": { + "methods": [ + "updatePatchDeployment" + ] + }, + "PausePatchDeployment": { + "methods": [ + "pausePatchDeployment" + ] + }, + "ResumePatchDeployment": { + "methods": [ + "resumePatchDeployment" + ] + }, + "ListPatchJobs": { + "methods": [ + "listPatchJobs", + "listPatchJobsStream", + "listPatchJobsAsync" + ] + }, + "ListPatchJobInstanceDetails": { + "methods": [ + "listPatchJobInstanceDetails", + "listPatchJobInstanceDetailsStream", + "listPatchJobInstanceDetailsAsync" + ] + }, + "ListPatchDeployments": { + "methods": [ + "listPatchDeployments", + "listPatchDeploymentsStream", + "listPatchDeploymentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "OsConfigServiceClient", + "rpcs": { + "ExecutePatchJob": { + "methods": [ + "executePatchJob" + ] + }, + "GetPatchJob": { + "methods": [ + "getPatchJob" + ] + }, + "CancelPatchJob": { + "methods": [ + "cancelPatchJob" + ] + }, + "CreatePatchDeployment": { + "methods": [ + "createPatchDeployment" + ] + }, + "GetPatchDeployment": { + "methods": [ + "getPatchDeployment" + ] + }, + "DeletePatchDeployment": { + "methods": [ + "deletePatchDeployment" + ] + }, + "UpdatePatchDeployment": { + "methods": [ + "updatePatchDeployment" + ] + }, + "PausePatchDeployment": { + "methods": [ + "pausePatchDeployment" + ] + }, + "ResumePatchDeployment": { + "methods": [ + "resumePatchDeployment" + ] + }, + "ListPatchJobs": { + "methods": [ + "listPatchJobs", + "listPatchJobsStream", + "listPatchJobsAsync" + ] + }, + "ListPatchJobInstanceDetails": { + "methods": [ + "listPatchJobInstanceDetails", + "listPatchJobInstanceDetailsStream", + "listPatchJobInstanceDetailsAsync" + ] + }, + "ListPatchDeployments": { + "methods": [ + "listPatchDeployments", + "listPatchDeploymentsStream", + "listPatchDeploymentsAsync" + ] + } + } + } + } + }, + "OsConfigZonalService": { + "clients": { + "grpc": { + "libraryClient": "OsConfigZonalServiceClient", + "rpcs": { + "GetOSPolicyAssignment": { + "methods": [ + "getOSPolicyAssignment" + ] + }, + "GetOSPolicyAssignmentReport": { + "methods": [ + "getOSPolicyAssignmentReport" + ] + }, + "GetInventory": { + "methods": [ + "getInventory" + ] + }, + "GetVulnerabilityReport": { + "methods": [ + "getVulnerabilityReport" + ] + }, + "CreateOSPolicyAssignment": { + "methods": [ + "createOSPolicyAssignment" + ] + }, + "UpdateOSPolicyAssignment": { + "methods": [ + "updateOSPolicyAssignment" + ] + }, + "DeleteOSPolicyAssignment": { + "methods": [ + "deleteOSPolicyAssignment" + ] + }, + "ListOSPolicyAssignments": { + "methods": [ + "listOSPolicyAssignments", + "listOSPolicyAssignmentsStream", + "listOSPolicyAssignmentsAsync" + ] + }, + "ListOSPolicyAssignmentRevisions": { + "methods": [ + "listOSPolicyAssignmentRevisions", + "listOSPolicyAssignmentRevisionsStream", + "listOSPolicyAssignmentRevisionsAsync" + ] + }, + "ListOSPolicyAssignmentReports": { + "methods": [ + "listOSPolicyAssignmentReports", + "listOSPolicyAssignmentReportsStream", + "listOSPolicyAssignmentReportsAsync" + ] + }, + "ListInventories": { + "methods": [ + "listInventories", + "listInventoriesStream", + "listInventoriesAsync" + ] + }, + "ListVulnerabilityReports": { + "methods": [ + "listVulnerabilityReports", + "listVulnerabilityReportsStream", + "listVulnerabilityReportsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "OsConfigZonalServiceClient", + "rpcs": { + "GetOSPolicyAssignment": { + "methods": [ + "getOSPolicyAssignment" + ] + }, + "GetOSPolicyAssignmentReport": { + "methods": [ + "getOSPolicyAssignmentReport" + ] + }, + "GetInventory": { + "methods": [ + "getInventory" + ] + }, + "GetVulnerabilityReport": { + "methods": [ + "getVulnerabilityReport" + ] + }, + "CreateOSPolicyAssignment": { + "methods": [ + "createOSPolicyAssignment" + ] + }, + "UpdateOSPolicyAssignment": { + "methods": [ + "updateOSPolicyAssignment" + ] + }, + "DeleteOSPolicyAssignment": { + "methods": [ + "deleteOSPolicyAssignment" + ] + }, + "ListOSPolicyAssignments": { + "methods": [ + "listOSPolicyAssignments", + "listOSPolicyAssignmentsStream", + "listOSPolicyAssignmentsAsync" + ] + }, + "ListOSPolicyAssignmentRevisions": { + "methods": [ + "listOSPolicyAssignmentRevisions", + "listOSPolicyAssignmentRevisionsStream", + "listOSPolicyAssignmentRevisionsAsync" + ] + }, + "ListOSPolicyAssignmentReports": { + "methods": [ + "listOSPolicyAssignmentReports", + "listOSPolicyAssignmentReportsStream", + "listOSPolicyAssignmentReportsAsync" + ] + }, + "ListInventories": { + "methods": [ + "listInventories", + "listInventoriesStream", + "listInventoriesAsync" + ] + }, + "ListVulnerabilityReports": { + "methods": [ + "listVulnerabilityReports", + "listVulnerabilityReportsStream", + "listVulnerabilityReportsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-osconfig/src/v1/index.ts b/packages/google-cloud-osconfig/src/v1/index.ts new file mode 100644 index 00000000000..df424b9f6a8 --- /dev/null +++ b/packages/google-cloud-osconfig/src/v1/index.ts @@ -0,0 +1,20 @@ +// 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 {OsConfigServiceClient} from './os_config_service_client'; +export {OsConfigZonalServiceClient} from './os_config_zonal_service_client'; diff --git a/packages/google-cloud-osconfig/src/v1/os_config_service_client.ts b/packages/google-cloud-osconfig/src/v1/os_config_service_client.ts new file mode 100644 index 00000000000..f7692fd8d61 --- /dev/null +++ b/packages/google-cloud-osconfig/src/v1/os_config_service_client.ts @@ -0,0 +1,2170 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/os_config_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './os_config_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * OS Config API + * + * The OS Config service is a server-side component that you can use to + * manage package installations and patch jobs for virtual machine instances. + * @class + * @memberof v1 + */ +export class OsConfigServiceClient { + 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}; + osConfigServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of OsConfigServiceClient. + * + * @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 OsConfigServiceClient({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 OsConfigServiceClient; + 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 = { + inventoryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/inventory' + ), + oSPolicyAssignmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}' + ), + oSPolicyAssignmentReportPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report' + ), + patchDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/patchDeployments/{patch_deployment}' + ), + patchJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/patchJobs/{patch_job}' + ), + vulnerabilityReportPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport' + ), + }; + + // 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 = { + listPatchJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'patchJobs' + ), + listPatchJobInstanceDetails: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'patchJobInstanceDetails' + ), + listPatchDeployments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'patchDeployments' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.osconfig.v1.OsConfigService', + 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.osConfigServiceStub) { + return this.osConfigServiceStub; + } + + // Put together the "service stub" for + // google.cloud.osconfig.v1.OsConfigService. + this.osConfigServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.osconfig.v1.OsConfigService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.osconfig.v1.OsConfigService, + 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 osConfigServiceStubMethods = [ + 'executePatchJob', + 'getPatchJob', + 'cancelPatchJob', + 'listPatchJobs', + 'listPatchJobInstanceDetails', + 'createPatchDeployment', + 'getPatchDeployment', + 'listPatchDeployments', + 'deletePatchDeployment', + 'updatePatchDeployment', + 'pausePatchDeployment', + 'resumePatchDeployment', + ]; + for (const methodName of osConfigServiceStubMethods) { + const callPromise = this.osConfigServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.osConfigServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'osconfig.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 'osconfig.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 -- + // ------------------- + /** + * Patch VM instances by creating and running a patch job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project in which to run this patch in the form `projects/*` + * @param {string} request.description + * Description of the patch job. Length of the description is limited + * to 1024 characters. + * @param {google.cloud.osconfig.v1.PatchInstanceFilter} request.instanceFilter + * Required. Instances to patch, either explicitly or filtered by some + * criteria such as zone or labels. + * @param {google.cloud.osconfig.v1.PatchConfig} request.patchConfig + * Patch configuration being applied. If omitted, instances are + * patched using the default configurations. + * @param {google.protobuf.Duration} request.duration + * Duration of the patch job. After the duration ends, the patch job + * times out. + * @param {boolean} request.dryRun + * If this patch is a dry-run only, instances are contacted but + * will do nothing. + * @param {string} request.displayName + * Display name for this patch job. This does not have to be unique. + * @param {google.cloud.osconfig.v1.PatchRollout} request.rollout + * Rollout strategy of the patch job. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PatchJob]{@link google.cloud.osconfig.v1.PatchJob}. + * 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/os_config_service.execute_patch_job.js + * region_tag:osconfig_v1_generated_OsConfigService_ExecutePatchJob_async + */ + executePatchJob( + request?: protos.google.cloud.osconfig.v1.IExecutePatchJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchJob, + protos.google.cloud.osconfig.v1.IExecutePatchJobRequest | undefined, + {} | undefined + ] + >; + executePatchJob( + request: protos.google.cloud.osconfig.v1.IExecutePatchJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchJob, + | protos.google.cloud.osconfig.v1.IExecutePatchJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + executePatchJob( + request: protos.google.cloud.osconfig.v1.IExecutePatchJobRequest, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchJob, + | protos.google.cloud.osconfig.v1.IExecutePatchJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + executePatchJob( + request?: protos.google.cloud.osconfig.v1.IExecutePatchJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1.IPatchJob, + | protos.google.cloud.osconfig.v1.IExecutePatchJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1.IPatchJob, + | protos.google.cloud.osconfig.v1.IExecutePatchJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchJob, + protos.google.cloud.osconfig.v1.IExecutePatchJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.executePatchJob(request, options, callback); + } + /** + * Get the patch job. This can be used to track the progress of an + * ongoing patch job or review the details of completed jobs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the patch in the form `projects/* /patchJobs/*` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PatchJob]{@link google.cloud.osconfig.v1.PatchJob}. + * 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/os_config_service.get_patch_job.js + * region_tag:osconfig_v1_generated_OsConfigService_GetPatchJob_async + */ + getPatchJob( + request?: protos.google.cloud.osconfig.v1.IGetPatchJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchJob, + protos.google.cloud.osconfig.v1.IGetPatchJobRequest | undefined, + {} | undefined + ] + >; + getPatchJob( + request: protos.google.cloud.osconfig.v1.IGetPatchJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchJob, + protos.google.cloud.osconfig.v1.IGetPatchJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getPatchJob( + request: protos.google.cloud.osconfig.v1.IGetPatchJobRequest, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchJob, + protos.google.cloud.osconfig.v1.IGetPatchJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getPatchJob( + request?: protos.google.cloud.osconfig.v1.IGetPatchJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1.IPatchJob, + | protos.google.cloud.osconfig.v1.IGetPatchJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1.IPatchJob, + protos.google.cloud.osconfig.v1.IGetPatchJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchJob, + protos.google.cloud.osconfig.v1.IGetPatchJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getPatchJob(request, options, callback); + } + /** + * Cancel a patch job. The patch job must be active. Canceled patch jobs + * cannot be restarted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the patch in the form `projects/* /patchJobs/*` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PatchJob]{@link google.cloud.osconfig.v1.PatchJob}. + * 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/os_config_service.cancel_patch_job.js + * region_tag:osconfig_v1_generated_OsConfigService_CancelPatchJob_async + */ + cancelPatchJob( + request?: protos.google.cloud.osconfig.v1.ICancelPatchJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchJob, + protos.google.cloud.osconfig.v1.ICancelPatchJobRequest | undefined, + {} | undefined + ] + >; + cancelPatchJob( + request: protos.google.cloud.osconfig.v1.ICancelPatchJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchJob, + protos.google.cloud.osconfig.v1.ICancelPatchJobRequest | null | undefined, + {} | null | undefined + > + ): void; + cancelPatchJob( + request: protos.google.cloud.osconfig.v1.ICancelPatchJobRequest, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchJob, + protos.google.cloud.osconfig.v1.ICancelPatchJobRequest | null | undefined, + {} | null | undefined + > + ): void; + cancelPatchJob( + request?: protos.google.cloud.osconfig.v1.ICancelPatchJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1.IPatchJob, + | protos.google.cloud.osconfig.v1.ICancelPatchJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1.IPatchJob, + protos.google.cloud.osconfig.v1.ICancelPatchJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchJob, + protos.google.cloud.osconfig.v1.ICancelPatchJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.cancelPatchJob(request, options, callback); + } + /** + * Create an OS Config patch deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to apply this patch deployment to in the form + * `projects/*`. + * @param {string} request.patchDeploymentId + * Required. A name for the patch deployment in the project. When creating a + * name the following rules apply: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the project. + * @param {google.cloud.osconfig.v1.PatchDeployment} request.patchDeployment + * Required. The patch deployment to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PatchDeployment]{@link google.cloud.osconfig.v1.PatchDeployment}. + * 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/os_config_service.create_patch_deployment.js + * region_tag:osconfig_v1_generated_OsConfigService_CreatePatchDeployment_async + */ + createPatchDeployment( + request?: protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchDeployment, + protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest | undefined, + {} | undefined + ] + >; + createPatchDeployment( + request: protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createPatchDeployment( + request: protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createPatchDeployment( + request?: protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchDeployment, + protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createPatchDeployment(request, options, callback); + } + /** + * Get an OS Config patch deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the patch deployment in the form + * `projects/* /patchDeployments/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PatchDeployment]{@link google.cloud.osconfig.v1.PatchDeployment}. + * 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/os_config_service.get_patch_deployment.js + * region_tag:osconfig_v1_generated_OsConfigService_GetPatchDeployment_async + */ + getPatchDeployment( + request?: protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchDeployment, + protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest | undefined, + {} | undefined + ] + >; + getPatchDeployment( + request: protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPatchDeployment( + request: protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPatchDeployment( + request?: protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchDeployment, + protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getPatchDeployment(request, options, callback); + } + /** + * Delete an OS Config patch deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the patch deployment in the form + * `projects/* /patchDeployments/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/os_config_service.delete_patch_deployment.js + * region_tag:osconfig_v1_generated_OsConfigService_DeletePatchDeployment_async + */ + deletePatchDeployment( + request?: protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest | undefined, + {} | undefined + ] + >; + deletePatchDeployment( + request: protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePatchDeployment( + request: protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePatchDeployment( + request?: protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.deletePatchDeployment(request, options, callback); + } + /** + * Update an OS Config patch deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.osconfig.v1.PatchDeployment} request.patchDeployment + * Required. The patch deployment to Update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask that controls which fields of the patch deployment + * should 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 [PatchDeployment]{@link google.cloud.osconfig.v1.PatchDeployment}. + * 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/os_config_service.update_patch_deployment.js + * region_tag:osconfig_v1_generated_OsConfigService_UpdatePatchDeployment_async + */ + updatePatchDeployment( + request?: protos.google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchDeployment, + protos.google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest | undefined, + {} | undefined + ] + >; + updatePatchDeployment( + request: protos.google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updatePatchDeployment( + request: protos.google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updatePatchDeployment( + request?: protos.google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchDeployment, + protos.google.cloud.osconfig.v1.IUpdatePatchDeploymentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'patch_deployment.name': request.patchDeployment!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updatePatchDeployment(request, options, callback); + } + /** + * Change state of patch deployment to "PAUSED". + * Patch deployment in paused state doesn't generate patch jobs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the patch deployment in the form + * `projects/* /patchDeployments/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PatchDeployment]{@link google.cloud.osconfig.v1.PatchDeployment}. + * 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/os_config_service.pause_patch_deployment.js + * region_tag:osconfig_v1_generated_OsConfigService_PausePatchDeployment_async + */ + pausePatchDeployment( + request?: protos.google.cloud.osconfig.v1.IPausePatchDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchDeployment, + protos.google.cloud.osconfig.v1.IPausePatchDeploymentRequest | undefined, + {} | undefined + ] + >; + pausePatchDeployment( + request: protos.google.cloud.osconfig.v1.IPausePatchDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IPausePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + pausePatchDeployment( + request: protos.google.cloud.osconfig.v1.IPausePatchDeploymentRequest, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IPausePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + pausePatchDeployment( + request?: protos.google.cloud.osconfig.v1.IPausePatchDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IPausePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IPausePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchDeployment, + protos.google.cloud.osconfig.v1.IPausePatchDeploymentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.pausePatchDeployment(request, options, callback); + } + /** + * Change state of patch deployment back to "ACTIVE". + * Patch deployment in active state continues to generate patch jobs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the patch deployment in the form + * `projects/* /patchDeployments/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PatchDeployment]{@link google.cloud.osconfig.v1.PatchDeployment}. + * 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/os_config_service.resume_patch_deployment.js + * region_tag:osconfig_v1_generated_OsConfigService_ResumePatchDeployment_async + */ + resumePatchDeployment( + request?: protos.google.cloud.osconfig.v1.IResumePatchDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchDeployment, + protos.google.cloud.osconfig.v1.IResumePatchDeploymentRequest | undefined, + {} | undefined + ] + >; + resumePatchDeployment( + request: protos.google.cloud.osconfig.v1.IResumePatchDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IResumePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + resumePatchDeployment( + request: protos.google.cloud.osconfig.v1.IResumePatchDeploymentRequest, + callback: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IResumePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + resumePatchDeployment( + request?: protos.google.cloud.osconfig.v1.IResumePatchDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IResumePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1.IPatchDeployment, + | protos.google.cloud.osconfig.v1.IResumePatchDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchDeployment, + protos.google.cloud.osconfig.v1.IResumePatchDeploymentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.resumePatchDeployment(request, options, callback); + } + + /** + * Get a list of patch jobs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. In the form of `projects/*` + * @param {number} request.pageSize + * The maximum number of instance status to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call + * that indicates where this listing should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by patch + * jobs to be included in the response. + * Currently, filtering is only available on the patch_deployment field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [PatchJob]{@link google.cloud.osconfig.v1.PatchJob}. + * 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 `listPatchJobsAsync()` + * 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. + */ + listPatchJobs( + request?: protos.google.cloud.osconfig.v1.IListPatchJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchJob[], + protos.google.cloud.osconfig.v1.IListPatchJobsRequest | null, + protos.google.cloud.osconfig.v1.IListPatchJobsResponse + ] + >; + listPatchJobs( + request: protos.google.cloud.osconfig.v1.IListPatchJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListPatchJobsRequest, + protos.google.cloud.osconfig.v1.IListPatchJobsResponse | null | undefined, + protos.google.cloud.osconfig.v1.IPatchJob + > + ): void; + listPatchJobs( + request: protos.google.cloud.osconfig.v1.IListPatchJobsRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListPatchJobsRequest, + protos.google.cloud.osconfig.v1.IListPatchJobsResponse | null | undefined, + protos.google.cloud.osconfig.v1.IPatchJob + > + ): void; + listPatchJobs( + request?: protos.google.cloud.osconfig.v1.IListPatchJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1.IListPatchJobsRequest, + | protos.google.cloud.osconfig.v1.IListPatchJobsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IPatchJob + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1.IListPatchJobsRequest, + protos.google.cloud.osconfig.v1.IListPatchJobsResponse | null | undefined, + protos.google.cloud.osconfig.v1.IPatchJob + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchJob[], + protos.google.cloud.osconfig.v1.IListPatchJobsRequest | null, + protos.google.cloud.osconfig.v1.IListPatchJobsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listPatchJobs(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. In the form of `projects/*` + * @param {number} request.pageSize + * The maximum number of instance status to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call + * that indicates where this listing should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by patch + * jobs to be included in the response. + * Currently, filtering is only available on the patch_deployment field. + * @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 [PatchJob]{@link google.cloud.osconfig.v1.PatchJob} 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 `listPatchJobsAsync()` + * 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. + */ + listPatchJobsStream( + request?: protos.google.cloud.osconfig.v1.IListPatchJobsRequest, + 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['listPatchJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPatchJobs.createStream( + this.innerApiCalls.listPatchJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPatchJobs`, 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. In the form of `projects/*` + * @param {number} request.pageSize + * The maximum number of instance status to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call + * that indicates where this listing should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by patch + * jobs to be included in the response. + * Currently, filtering is only available on the patch_deployment field. + * @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 + * [PatchJob]{@link google.cloud.osconfig.v1.PatchJob}. 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/os_config_service.list_patch_jobs.js + * region_tag:osconfig_v1_generated_OsConfigService_ListPatchJobs_async + */ + listPatchJobsAsync( + request?: protos.google.cloud.osconfig.v1.IListPatchJobsRequest, + 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['listPatchJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPatchJobs.asyncIterate( + this.innerApiCalls['listPatchJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Get a list of instance details for a given patch job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent for the instances are in the form of + * `projects/* /patchJobs/*`. + * @param {number} request.pageSize + * The maximum number of instance details records to return. Default is 100. + * @param {string} request.pageToken + * A pagination token returned from a previous call + * that indicates where this listing should continue from. + * @param {string} request.filter + * A filter expression that filters results listed in the response. This + * field supports filtering results by instance zone, name, state, or + * `failure_reason`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PatchJobInstanceDetails]{@link google.cloud.osconfig.v1.PatchJobInstanceDetails}. + * 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 `listPatchJobInstanceDetailsAsync()` + * 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. + */ + listPatchJobInstanceDetails( + request?: protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails[], + protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest | null, + protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse + ] + >; + listPatchJobInstanceDetails( + request: protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, + | protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails + > + ): void; + listPatchJobInstanceDetails( + request: protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, + | protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails + > + ): void; + listPatchJobInstanceDetails( + request?: protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, + | protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, + | protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails[], + protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest | null, + protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listPatchJobInstanceDetails( + 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 for the instances are in the form of + * `projects/* /patchJobs/*`. + * @param {number} request.pageSize + * The maximum number of instance details records to return. Default is 100. + * @param {string} request.pageToken + * A pagination token returned from a previous call + * that indicates where this listing should continue from. + * @param {string} request.filter + * A filter expression that filters results listed in the response. This + * field supports filtering results by instance zone, name, state, or + * `failure_reason`. + * @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 [PatchJobInstanceDetails]{@link google.cloud.osconfig.v1.PatchJobInstanceDetails} 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 `listPatchJobInstanceDetailsAsync()` + * 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. + */ + listPatchJobInstanceDetailsStream( + request?: protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, + 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['listPatchJobInstanceDetails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPatchJobInstanceDetails.createStream( + this.innerApiCalls.listPatchJobInstanceDetails as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPatchJobInstanceDetails`, 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 for the instances are in the form of + * `projects/* /patchJobs/*`. + * @param {number} request.pageSize + * The maximum number of instance details records to return. Default is 100. + * @param {string} request.pageToken + * A pagination token returned from a previous call + * that indicates where this listing should continue from. + * @param {string} request.filter + * A filter expression that filters results listed in the response. This + * field supports filtering results by instance zone, name, state, or + * `failure_reason`. + * @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 + * [PatchJobInstanceDetails]{@link google.cloud.osconfig.v1.PatchJobInstanceDetails}. 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/os_config_service.list_patch_job_instance_details.js + * region_tag:osconfig_v1_generated_OsConfigService_ListPatchJobInstanceDetails_async + */ + listPatchJobInstanceDetailsAsync( + request?: protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, + 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['listPatchJobInstanceDetails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPatchJobInstanceDetails.asyncIterate( + this.innerApiCalls['listPatchJobInstanceDetails'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Get a page of OS Config patch deployments. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent in the form `projects/*`. + * @param {number} [request.pageSize] + * Optional. The maximum number of patch deployments to return. Default is + * 100. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to + * ListPatchDeployments that indicates where this listing should continue + * from. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PatchDeployment]{@link google.cloud.osconfig.v1.PatchDeployment}. + * 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 `listPatchDeploymentsAsync()` + * 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. + */ + listPatchDeployments( + request?: protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchDeployment[], + protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest | null, + protos.google.cloud.osconfig.v1.IListPatchDeploymentsResponse + ] + >; + listPatchDeployments( + request: protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, + | protos.google.cloud.osconfig.v1.IListPatchDeploymentsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IPatchDeployment + > + ): void; + listPatchDeployments( + request: protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, + | protos.google.cloud.osconfig.v1.IListPatchDeploymentsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IPatchDeployment + > + ): void; + listPatchDeployments( + request?: protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, + | protos.google.cloud.osconfig.v1.IListPatchDeploymentsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IPatchDeployment + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, + | protos.google.cloud.osconfig.v1.IListPatchDeploymentsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IPatchDeployment + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IPatchDeployment[], + protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest | null, + protos.google.cloud.osconfig.v1.IListPatchDeploymentsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listPatchDeployments(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent in the form `projects/*`. + * @param {number} [request.pageSize] + * Optional. The maximum number of patch deployments to return. Default is + * 100. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to + * ListPatchDeployments that indicates where this listing should continue + * from. + * @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 [PatchDeployment]{@link google.cloud.osconfig.v1.PatchDeployment} 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 `listPatchDeploymentsAsync()` + * 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. + */ + listPatchDeploymentsStream( + request?: protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, + 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['listPatchDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPatchDeployments.createStream( + this.innerApiCalls.listPatchDeployments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPatchDeployments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent in the form `projects/*`. + * @param {number} [request.pageSize] + * Optional. The maximum number of patch deployments to return. Default is + * 100. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to + * ListPatchDeployments that indicates where this listing should continue + * from. + * @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 + * [PatchDeployment]{@link google.cloud.osconfig.v1.PatchDeployment}. 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/os_config_service.list_patch_deployments.js + * region_tag:osconfig_v1_generated_OsConfigService_ListPatchDeployments_async + */ + listPatchDeploymentsAsync( + request?: protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, + 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['listPatchDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPatchDeployments.asyncIterate( + this.innerApiCalls['listPatchDeployments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified inventory resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + inventoryPath(project: string, location: string, instance: string) { + return this.pathTemplates.inventoryPathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .project; + } + + /** + * Parse the location from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .location; + } + + /** + * Parse the instance from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .instance; + } + + /** + * Return a fully-qualified oSPolicyAssignment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} os_policy_assignment + * @returns {string} Resource name string. + */ + oSPolicyAssignmentPath( + project: string, + location: string, + osPolicyAssignment: string + ) { + return this.pathTemplates.oSPolicyAssignmentPathTemplate.render({ + project: project, + location: location, + os_policy_assignment: osPolicyAssignment, + }); + } + + /** + * Parse the project from OSPolicyAssignment resource. + * + * @param {string} oSPolicyAssignmentName + * A fully-qualified path representing OSPolicyAssignment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOSPolicyAssignmentName(oSPolicyAssignmentName: string) { + return this.pathTemplates.oSPolicyAssignmentPathTemplate.match( + oSPolicyAssignmentName + ).project; + } + + /** + * Parse the location from OSPolicyAssignment resource. + * + * @param {string} oSPolicyAssignmentName + * A fully-qualified path representing OSPolicyAssignment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOSPolicyAssignmentName(oSPolicyAssignmentName: string) { + return this.pathTemplates.oSPolicyAssignmentPathTemplate.match( + oSPolicyAssignmentName + ).location; + } + + /** + * Parse the os_policy_assignment from OSPolicyAssignment resource. + * + * @param {string} oSPolicyAssignmentName + * A fully-qualified path representing OSPolicyAssignment resource. + * @returns {string} A string representing the os_policy_assignment. + */ + matchOsPolicyAssignmentFromOSPolicyAssignmentName( + oSPolicyAssignmentName: string + ) { + return this.pathTemplates.oSPolicyAssignmentPathTemplate.match( + oSPolicyAssignmentName + ).os_policy_assignment; + } + + /** + * Return a fully-qualified oSPolicyAssignmentReport resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @param {string} assignment + * @returns {string} Resource name string. + */ + oSPolicyAssignmentReportPath( + project: string, + location: string, + instance: string, + assignment: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.render({ + project: project, + location: location, + instance: instance, + assignment: assignment, + }); + } + + /** + * Parse the project from OSPolicyAssignmentReport resource. + * + * @param {string} oSPolicyAssignmentReportName + * A fully-qualified path representing OSPolicyAssignmentReport resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOSPolicyAssignmentReportName( + oSPolicyAssignmentReportName: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.match( + oSPolicyAssignmentReportName + ).project; + } + + /** + * Parse the location from OSPolicyAssignmentReport resource. + * + * @param {string} oSPolicyAssignmentReportName + * A fully-qualified path representing OSPolicyAssignmentReport resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOSPolicyAssignmentReportName( + oSPolicyAssignmentReportName: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.match( + oSPolicyAssignmentReportName + ).location; + } + + /** + * Parse the instance from OSPolicyAssignmentReport resource. + * + * @param {string} oSPolicyAssignmentReportName + * A fully-qualified path representing OSPolicyAssignmentReport resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromOSPolicyAssignmentReportName( + oSPolicyAssignmentReportName: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.match( + oSPolicyAssignmentReportName + ).instance; + } + + /** + * Parse the assignment from OSPolicyAssignmentReport resource. + * + * @param {string} oSPolicyAssignmentReportName + * A fully-qualified path representing OSPolicyAssignmentReport resource. + * @returns {string} A string representing the assignment. + */ + matchAssignmentFromOSPolicyAssignmentReportName( + oSPolicyAssignmentReportName: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.match( + oSPolicyAssignmentReportName + ).assignment; + } + + /** + * Return a fully-qualified patchDeployment resource name string. + * + * @param {string} project + * @param {string} patch_deployment + * @returns {string} Resource name string. + */ + patchDeploymentPath(project: string, patchDeployment: string) { + return this.pathTemplates.patchDeploymentPathTemplate.render({ + project: project, + patch_deployment: patchDeployment, + }); + } + + /** + * Parse the project from PatchDeployment resource. + * + * @param {string} patchDeploymentName + * A fully-qualified path representing PatchDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPatchDeploymentName(patchDeploymentName: string) { + return this.pathTemplates.patchDeploymentPathTemplate.match( + patchDeploymentName + ).project; + } + + /** + * Parse the patch_deployment from PatchDeployment resource. + * + * @param {string} patchDeploymentName + * A fully-qualified path representing PatchDeployment resource. + * @returns {string} A string representing the patch_deployment. + */ + matchPatchDeploymentFromPatchDeploymentName(patchDeploymentName: string) { + return this.pathTemplates.patchDeploymentPathTemplate.match( + patchDeploymentName + ).patch_deployment; + } + + /** + * Return a fully-qualified patchJob resource name string. + * + * @param {string} project + * @param {string} patch_job + * @returns {string} Resource name string. + */ + patchJobPath(project: string, patchJob: string) { + return this.pathTemplates.patchJobPathTemplate.render({ + project: project, + patch_job: patchJob, + }); + } + + /** + * Parse the project from PatchJob resource. + * + * @param {string} patchJobName + * A fully-qualified path representing PatchJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPatchJobName(patchJobName: string) { + return this.pathTemplates.patchJobPathTemplate.match(patchJobName).project; + } + + /** + * Parse the patch_job from PatchJob resource. + * + * @param {string} patchJobName + * A fully-qualified path representing PatchJob resource. + * @returns {string} A string representing the patch_job. + */ + matchPatchJobFromPatchJobName(patchJobName: string) { + return this.pathTemplates.patchJobPathTemplate.match(patchJobName) + .patch_job; + } + + /** + * Return a fully-qualified vulnerabilityReport resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + vulnerabilityReportPath(project: string, location: string, instance: string) { + return this.pathTemplates.vulnerabilityReportPathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from VulnerabilityReport resource. + * + * @param {string} vulnerabilityReportName + * A fully-qualified path representing VulnerabilityReport resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVulnerabilityReportName(vulnerabilityReportName: string) { + return this.pathTemplates.vulnerabilityReportPathTemplate.match( + vulnerabilityReportName + ).project; + } + + /** + * Parse the location from VulnerabilityReport resource. + * + * @param {string} vulnerabilityReportName + * A fully-qualified path representing VulnerabilityReport resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVulnerabilityReportName(vulnerabilityReportName: string) { + return this.pathTemplates.vulnerabilityReportPathTemplate.match( + vulnerabilityReportName + ).location; + } + + /** + * Parse the instance from VulnerabilityReport resource. + * + * @param {string} vulnerabilityReportName + * A fully-qualified path representing VulnerabilityReport resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromVulnerabilityReportName(vulnerabilityReportName: string) { + return this.pathTemplates.vulnerabilityReportPathTemplate.match( + vulnerabilityReportName + ).instance; + } + + /** + * 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.osConfigServiceStub && !this._terminated) { + return this.osConfigServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-osconfig/src/v1/os_config_service_client_config.json b/packages/google-cloud-osconfig/src/v1/os_config_service_client_config.json new file mode 100644 index 00000000000..49ac0b9b644 --- /dev/null +++ b/packages/google-cloud-osconfig/src/v1/os_config_service_client_config.json @@ -0,0 +1,98 @@ +{ + "interfaces": { + "google.cloud.osconfig.v1.OsConfigService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { + "initial_retry_delay_millis": 1000, + "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": { + "ExecutePatchJob": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetPatchJob": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CancelPatchJob": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListPatchJobs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListPatchJobInstanceDetails": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreatePatchDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetPatchDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListPatchDeployments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeletePatchDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdatePatchDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "PausePatchDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ResumePatchDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + } + } + } + } +} diff --git a/packages/google-cloud-osconfig/src/v1/os_config_service_proto_list.json b/packages/google-cloud-osconfig/src/v1/os_config_service_proto_list.json new file mode 100644 index 00000000000..e074f70ca02 --- /dev/null +++ b/packages/google-cloud-osconfig/src/v1/os_config_service_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/osconfig/v1/inventory.proto", + "../../protos/google/cloud/osconfig/v1/os_policy.proto", + "../../protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto", + "../../protos/google/cloud/osconfig/v1/os_policy_assignments.proto", + "../../protos/google/cloud/osconfig/v1/osconfig_common.proto", + "../../protos/google/cloud/osconfig/v1/osconfig_service.proto", + "../../protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto", + "../../protos/google/cloud/osconfig/v1/patch_deployments.proto", + "../../protos/google/cloud/osconfig/v1/patch_jobs.proto", + "../../protos/google/cloud/osconfig/v1/vulnerability.proto" +] diff --git a/packages/google-cloud-osconfig/src/v1/os_config_zonal_service_client.ts b/packages/google-cloud-osconfig/src/v1/os_config_zonal_service_client.ts new file mode 100644 index 00000000000..589fd2729fb --- /dev/null +++ b/packages/google-cloud-osconfig/src/v1/os_config_zonal_service_client.ts @@ -0,0 +1,2803 @@ +// 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/os_config_zonal_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './os_config_zonal_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Zonal OS Config API + * + * The OS Config service is the server-side component that allows users to + * manage package installations and patch jobs for Compute Engine VM instances. + * @class + * @memberof v1 + */ +export class OsConfigZonalServiceClient { + 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; + osConfigZonalServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of OsConfigZonalServiceClient. + * + * @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 OsConfigZonalServiceClient({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 OsConfigZonalServiceClient; + 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 = { + inventoryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/inventory' + ), + oSPolicyAssignmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}' + ), + oSPolicyAssignmentReportPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report' + ), + patchDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/patchDeployments/{patch_deployment}' + ), + patchJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/patchJobs/{patch_job}' + ), + vulnerabilityReportPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport' + ), + }; + + // 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 = { + listOSPolicyAssignments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'osPolicyAssignments' + ), + listOSPolicyAssignmentRevisions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'osPolicyAssignments' + ), + listOSPolicyAssignmentReports: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'osPolicyAssignmentReports' + ), + listInventories: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'inventories' + ), + listVulnerabilityReports: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'vulnerabilityReports' + ), + }; + + 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=projects/*/locations/*/osPolicyAssignments/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/osPolicyAssignments/*/operations/*}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createOSPolicyAssignmentResponse = protoFilesRoot.lookup( + '.google.cloud.osconfig.v1.OSPolicyAssignment' + ) as gax.protobuf.Type; + const createOSPolicyAssignmentMetadata = protoFilesRoot.lookup( + '.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata' + ) as gax.protobuf.Type; + const updateOSPolicyAssignmentResponse = protoFilesRoot.lookup( + '.google.cloud.osconfig.v1.OSPolicyAssignment' + ) as gax.protobuf.Type; + const updateOSPolicyAssignmentMetadata = protoFilesRoot.lookup( + '.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata' + ) as gax.protobuf.Type; + const deleteOSPolicyAssignmentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteOSPolicyAssignmentMetadata = protoFilesRoot.lookup( + '.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createOSPolicyAssignment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createOSPolicyAssignmentResponse.decode.bind( + createOSPolicyAssignmentResponse + ), + createOSPolicyAssignmentMetadata.decode.bind( + createOSPolicyAssignmentMetadata + ) + ), + updateOSPolicyAssignment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateOSPolicyAssignmentResponse.decode.bind( + updateOSPolicyAssignmentResponse + ), + updateOSPolicyAssignmentMetadata.decode.bind( + updateOSPolicyAssignmentMetadata + ) + ), + deleteOSPolicyAssignment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteOSPolicyAssignmentResponse.decode.bind( + deleteOSPolicyAssignmentResponse + ), + deleteOSPolicyAssignmentMetadata.decode.bind( + deleteOSPolicyAssignmentMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.osconfig.v1.OsConfigZonalService', + 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.osConfigZonalServiceStub) { + return this.osConfigZonalServiceStub; + } + + // Put together the "service stub" for + // google.cloud.osconfig.v1.OsConfigZonalService. + this.osConfigZonalServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.osconfig.v1.OsConfigZonalService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.osconfig.v1.OsConfigZonalService, + 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 osConfigZonalServiceStubMethods = [ + 'createOsPolicyAssignment', + 'updateOsPolicyAssignment', + 'getOsPolicyAssignment', + 'listOsPolicyAssignments', + 'listOsPolicyAssignmentRevisions', + 'deleteOsPolicyAssignment', + 'getOsPolicyAssignmentReport', + 'listOsPolicyAssignmentReports', + 'getInventory', + 'listInventories', + 'getVulnerabilityReport', + 'listVulnerabilityReports', + ]; + for (const methodName of osConfigZonalServiceStubMethods) { + const callPromise = this.osConfigZonalServiceStub.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.osConfigZonalServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'osconfig.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 'osconfig.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 -- + // ------------------- + /** + * Retrieve an existing OS policy assignment. + * + * This method always returns the latest revision. In order to retrieve a + * previous revision of the assignment, also provide the revision ID in the + * `name` parameter. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of OS policy assignment. + * + * Format: + * `projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}@{revisionId}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OSPolicyAssignment]{@link google.cloud.osconfig.v1.OSPolicyAssignment}. + * 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/os_config_zonal_service.get_o_s_policy_assignment.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignment_async + */ + getOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest | undefined, + {} | undefined + ] + >; + getOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + | protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest, + callback: Callback< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + | protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + | protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + | protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getOsPolicyAssignment(request, options, callback); + } + /** + * Get the OS policy asssignment report for the specified Compute Engine VM + * instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. API resource name for OS policy assignment report. + * + * Format: + * `/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance_id}`, either Compute Engine `instance-id` or `instance-name` + * can be provided. + * For `{assignment_id}`, the OSPolicyAssignment id must be provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OSPolicyAssignmentReport]{@link google.cloud.osconfig.v1.OSPolicyAssignmentReport}. + * 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/os_config_zonal_service.get_o_s_policy_assignment_report.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async + */ + getOSPolicyAssignmentReport( + request?: protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport, + ( + | protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest + | undefined + ), + {} | undefined + ] + >; + getOSPolicyAssignmentReport( + request: protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport, + | protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOSPolicyAssignmentReport( + request: protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest, + callback: Callback< + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport, + | protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOSPolicyAssignmentReport( + request?: protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport, + | protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport, + | protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport, + ( + | protos.google.cloud.osconfig.v1.IGetOSPolicyAssignmentReportRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getOsPolicyAssignmentReport( + request, + options, + callback + ); + } + /** + * Get inventory data for the specified VM instance. If the VM has no + * associated inventory, the message `NOT_FOUND` is returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. API resource name for inventory resource. + * + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/inventory` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either Compute Engine `instance-id` or `instance-name` + * can be provided. + * @param {google.cloud.osconfig.v1.InventoryView} request.view + * Inventory view indicating what information should be included in the + * inventory resource. If unspecified, the default view is BASIC. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Inventory]{@link google.cloud.osconfig.v1.Inventory}. + * 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/os_config_zonal_service.get_inventory.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_GetInventory_async + */ + getInventory( + request?: protos.google.cloud.osconfig.v1.IGetInventoryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IInventory, + protos.google.cloud.osconfig.v1.IGetInventoryRequest | undefined, + {} | undefined + ] + >; + getInventory( + request: protos.google.cloud.osconfig.v1.IGetInventoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1.IInventory, + protos.google.cloud.osconfig.v1.IGetInventoryRequest | null | undefined, + {} | null | undefined + > + ): void; + getInventory( + request: protos.google.cloud.osconfig.v1.IGetInventoryRequest, + callback: Callback< + protos.google.cloud.osconfig.v1.IInventory, + protos.google.cloud.osconfig.v1.IGetInventoryRequest | null | undefined, + {} | null | undefined + > + ): void; + getInventory( + request?: protos.google.cloud.osconfig.v1.IGetInventoryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1.IInventory, + | protos.google.cloud.osconfig.v1.IGetInventoryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1.IInventory, + protos.google.cloud.osconfig.v1.IGetInventoryRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IInventory, + protos.google.cloud.osconfig.v1.IGetInventoryRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getInventory(request, options, callback); + } + /** + * Gets the vulnerability report for the specified VM instance. Only VMs with + * inventory data have vulnerability reports associated with them. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. API resource name for vulnerability resource. + * + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either Compute Engine `instance-id` or `instance-name` + * can be provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [VulnerabilityReport]{@link google.cloud.osconfig.v1.VulnerabilityReport}. + * 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/os_config_zonal_service.get_vulnerability_report.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_GetVulnerabilityReport_async + */ + getVulnerabilityReport( + request?: protos.google.cloud.osconfig.v1.IGetVulnerabilityReportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IVulnerabilityReport, + ( + | protos.google.cloud.osconfig.v1.IGetVulnerabilityReportRequest + | undefined + ), + {} | undefined + ] + >; + getVulnerabilityReport( + request: protos.google.cloud.osconfig.v1.IGetVulnerabilityReportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1.IVulnerabilityReport, + | protos.google.cloud.osconfig.v1.IGetVulnerabilityReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getVulnerabilityReport( + request: protos.google.cloud.osconfig.v1.IGetVulnerabilityReportRequest, + callback: Callback< + protos.google.cloud.osconfig.v1.IVulnerabilityReport, + | protos.google.cloud.osconfig.v1.IGetVulnerabilityReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getVulnerabilityReport( + request?: protos.google.cloud.osconfig.v1.IGetVulnerabilityReportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1.IVulnerabilityReport, + | protos.google.cloud.osconfig.v1.IGetVulnerabilityReportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1.IVulnerabilityReport, + | protos.google.cloud.osconfig.v1.IGetVulnerabilityReportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IVulnerabilityReport, + ( + | protos.google.cloud.osconfig.v1.IGetVulnerabilityReportRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getVulnerabilityReport( + request, + options, + callback + ); + } + + /** + * Create an OS policy assignment. + * + * This method also creates the first revision of the OS policy assignment. + * + * This method returns a long running operation (LRO) that contains the + * rollout details. The rollout can be cancelled by cancelling the LRO. + * + * For more information, see [Method: + * projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name in the form: + * projects/{project}/locations/{location} + * @param {google.cloud.osconfig.v1.OSPolicyAssignment} request.osPolicyAssignment + * Required. The OS policy assignment to be created. + * @param {string} request.osPolicyAssignmentId + * Required. The logical name of the OS policy assignment in the project + * with the following restrictions: + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the project. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/os_config_zonal_service.create_o_s_policy_assignment.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_CreateOSPolicyAssignment_async + */ + createOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest, + callback: Callback< + LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1.ICreateOSPolicyAssignmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + 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.createOsPolicyAssignment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createOSPolicyAssignment()`. + * @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/os_config_zonal_service.create_o_s_policy_assignment.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_CreateOSPolicyAssignment_async + */ + async checkCreateOSPolicyAssignmentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.osconfig.v1.OSPolicyAssignment, + protos.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + > + > { + 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.createOSPolicyAssignment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.osconfig.v1.OSPolicyAssignment, + protos.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + >; + } + /** + * Update an existing OS policy assignment. + * + * This method creates a new revision of the OS policy assignment. + * + * This method returns a long running operation (LRO) that contains the + * rollout details. The rollout can be cancelled by cancelling the LRO. + * + * For more information, see [Method: + * projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.osconfig.v1.OSPolicyAssignment} request.osPolicyAssignment + * Required. The updated OS policy assignment. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask that controls which fields of the assignment should 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 + * 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/os_config_zonal_service.update_o_s_policy_assignment.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async + */ + updateOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest, + callback: Callback< + LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1.IUpdateOSPolicyAssignmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + 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({ + 'os_policy_assignment.name': request.osPolicyAssignment!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateOsPolicyAssignment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateOSPolicyAssignment()`. + * @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/os_config_zonal_service.update_o_s_policy_assignment.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async + */ + async checkUpdateOSPolicyAssignmentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.osconfig.v1.OSPolicyAssignment, + protos.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + > + > { + 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.updateOSPolicyAssignment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.osconfig.v1.OSPolicyAssignment, + protos.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + >; + } + /** + * Delete the OS policy assignment. + * + * This method creates a new revision of the OS policy assignment. + * + * This method returns a long running operation (LRO) that contains the + * rollout details. The rollout can be cancelled by cancelling the LRO. + * + * If the LRO completes and is not cancelled, all revisions associated with + * the OS policy assignment are deleted. + * + * For more information, see [Method: + * projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the OS policy assignment to be deleted + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [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/os_config_zonal_service.delete_o_s_policy_assignment.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async + */ + deleteOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1.IDeleteOSPolicyAssignmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteOsPolicyAssignment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteOSPolicyAssignment()`. + * @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/os_config_zonal_service.delete_o_s_policy_assignment.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async + */ + async checkDeleteOSPolicyAssignmentProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + > + > { + 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.deleteOSPolicyAssignment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata + >; + } + /** + * List the OS policy assignments under the parent resource. + * + * For each OS policy assignment, the latest revision is returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * @param {number} request.pageSize + * The maximum number of assignments to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListOSPolicyAssignments` that indicates where this listing should continue + * from. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [OSPolicyAssignment]{@link google.cloud.osconfig.v1.OSPolicyAssignment}. + * 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 `listOSPolicyAssignmentsAsync()` + * 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. + */ + listOSPolicyAssignments( + request?: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IOSPolicyAssignment[], + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest | null, + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse + ] + >; + listOSPolicyAssignments( + request: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest, + | protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IOSPolicyAssignment + > + ): void; + listOSPolicyAssignments( + request: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest, + | protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IOSPolicyAssignment + > + ): void; + listOSPolicyAssignments( + request?: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest, + | protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IOSPolicyAssignment + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest, + | protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IOSPolicyAssignment + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IOSPolicyAssignment[], + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest | null, + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listOsPolicyAssignments( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * @param {number} request.pageSize + * The maximum number of assignments to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListOSPolicyAssignments` that indicates where this listing should continue + * from. + * @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 [OSPolicyAssignment]{@link google.cloud.osconfig.v1.OSPolicyAssignment} 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 `listOSPolicyAssignmentsAsync()` + * 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. + */ + listOSPolicyAssignmentsStream( + request?: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest, + 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['listOsPolicyAssignments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOSPolicyAssignments.createStream( + this.innerApiCalls.listOsPolicyAssignments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listOSPolicyAssignments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * @param {number} request.pageSize + * The maximum number of assignments to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListOSPolicyAssignments` that indicates where this listing should continue + * from. + * @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 + * [OSPolicyAssignment]{@link google.cloud.osconfig.v1.OSPolicyAssignment}. 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/os_config_zonal_service.list_o_s_policy_assignments.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignments_async + */ + listOSPolicyAssignmentsAsync( + request?: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentsRequest, + 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['listOsPolicyAssignments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOSPolicyAssignments.asyncIterate( + this.innerApiCalls['listOsPolicyAssignments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List the OS policy assignment revisions for a given OS policy assignment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the OS policy assignment to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListOSPolicyAssignmentRevisions` that indicates where this listing should + * continue from. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [OSPolicyAssignment]{@link google.cloud.osconfig.v1.OSPolicyAssignment}. + * 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 `listOSPolicyAssignmentRevisionsAsync()` + * 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. + */ + listOSPolicyAssignmentRevisions( + request?: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IOSPolicyAssignment[], + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest | null, + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse + ] + >; + listOSPolicyAssignmentRevisions( + request: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest, + | protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IOSPolicyAssignment + > + ): void; + listOSPolicyAssignmentRevisions( + request: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest, + | protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IOSPolicyAssignment + > + ): void; + listOSPolicyAssignmentRevisions( + request?: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest, + | protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IOSPolicyAssignment + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest, + | protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IOSPolicyAssignment + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IOSPolicyAssignment[], + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest | null, + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.listOsPolicyAssignmentRevisions( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the OS policy assignment to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListOSPolicyAssignmentRevisions` that indicates where this listing should + * continue from. + * @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 [OSPolicyAssignment]{@link google.cloud.osconfig.v1.OSPolicyAssignment} 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 `listOSPolicyAssignmentRevisionsAsync()` + * 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. + */ + listOSPolicyAssignmentRevisionsStream( + request?: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + const defaultCallSettings = + this._defaults['listOsPolicyAssignmentRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOSPolicyAssignmentRevisions.createStream( + this.innerApiCalls.listOsPolicyAssignmentRevisions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listOSPolicyAssignmentRevisions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the OS policy assignment to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListOSPolicyAssignmentRevisions` that indicates where this listing should + * continue from. + * @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 + * [OSPolicyAssignment]{@link google.cloud.osconfig.v1.OSPolicyAssignment}. 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/os_config_zonal_service.list_o_s_policy_assignment_revisions.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async + */ + listOSPolicyAssignmentRevisionsAsync( + request?: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentRevisionsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + const defaultCallSettings = + this._defaults['listOsPolicyAssignmentRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOSPolicyAssignmentRevisions.asyncIterate( + this.innerApiCalls['listOsPolicyAssignmentRevisions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List OS policy asssignment reports for all Compute Engine VM instances in + * the specified zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + * provided. If '-' is provided, the response will include + * OSPolicyAssignmentReports for all instances in the project/location. + * For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + * is provided, the response will include OSPolicyAssignmentReports for all + * OSPolicyAssignments in the project/location. + * Either {instance} or {assignment} must be `-`. + * + * For example: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + * returns all reports for the instance + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + * returns all the reports for the given assignment across all instances. + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + * returns all the reports for all assignments across all instances. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by the + * `OSPolicyAssignmentReport` API resource that is included in the response. + * @param {string} request.pageToken + * A pagination token returned from a previous call to the + * `ListOSPolicyAssignmentReports` method that indicates where this listing + * should continue from. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [OSPolicyAssignmentReport]{@link google.cloud.osconfig.v1.OSPolicyAssignmentReport}. + * 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 `listOSPolicyAssignmentReportsAsync()` + * 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. + */ + listOSPolicyAssignmentReports( + request?: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport[], + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest | null, + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse + ] + >; + listOSPolicyAssignmentReports( + request: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest, + | protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport + > + ): void; + listOSPolicyAssignmentReports( + request: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest, + | protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport + > + ): void; + listOSPolicyAssignmentReports( + request?: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest, + | protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest, + | protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport[], + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest | null, + protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listOsPolicyAssignmentReports( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + * provided. If '-' is provided, the response will include + * OSPolicyAssignmentReports for all instances in the project/location. + * For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + * is provided, the response will include OSPolicyAssignmentReports for all + * OSPolicyAssignments in the project/location. + * Either {instance} or {assignment} must be `-`. + * + * For example: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + * returns all reports for the instance + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + * returns all the reports for the given assignment across all instances. + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + * returns all the reports for all assignments across all instances. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by the + * `OSPolicyAssignmentReport` API resource that is included in the response. + * @param {string} request.pageToken + * A pagination token returned from a previous call to the + * `ListOSPolicyAssignmentReports` method that indicates where this listing + * should continue from. + * @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 [OSPolicyAssignmentReport]{@link google.cloud.osconfig.v1.OSPolicyAssignmentReport} 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 `listOSPolicyAssignmentReportsAsync()` + * 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. + */ + listOSPolicyAssignmentReportsStream( + request?: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest, + 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['listOsPolicyAssignmentReports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOSPolicyAssignmentReports.createStream( + this.innerApiCalls.listOsPolicyAssignmentReports as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listOSPolicyAssignmentReports`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + * provided. If '-' is provided, the response will include + * OSPolicyAssignmentReports for all instances in the project/location. + * For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + * is provided, the response will include OSPolicyAssignmentReports for all + * OSPolicyAssignments in the project/location. + * Either {instance} or {assignment} must be `-`. + * + * For example: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + * returns all reports for the instance + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + * returns all the reports for the given assignment across all instances. + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + * returns all the reports for all assignments across all instances. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by the + * `OSPolicyAssignmentReport` API resource that is included in the response. + * @param {string} request.pageToken + * A pagination token returned from a previous call to the + * `ListOSPolicyAssignmentReports` method that indicates where this listing + * should continue from. + * @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 + * [OSPolicyAssignmentReport]{@link google.cloud.osconfig.v1.OSPolicyAssignmentReport}. 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/os_config_zonal_service.list_o_s_policy_assignment_reports.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async + */ + listOSPolicyAssignmentReportsAsync( + request?: protos.google.cloud.osconfig.v1.IListOSPolicyAssignmentReportsRequest, + 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['listOsPolicyAssignmentReports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOSPolicyAssignmentReports.asyncIterate( + this.innerApiCalls['listOsPolicyAssignmentReports'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List inventory data for all VM instances in the specified zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}/instances/-` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * @param {google.cloud.osconfig.v1.InventoryView} request.view + * Inventory view indicating what information should be included in the + * inventory resource. If unspecified, the default view is BASIC. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListInventories` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `Inventory` API resource to be included in the response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Inventory]{@link google.cloud.osconfig.v1.Inventory}. + * 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 `listInventoriesAsync()` + * 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. + */ + listInventories( + request?: protos.google.cloud.osconfig.v1.IListInventoriesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IInventory[], + protos.google.cloud.osconfig.v1.IListInventoriesRequest | null, + protos.google.cloud.osconfig.v1.IListInventoriesResponse + ] + >; + listInventories( + request: protos.google.cloud.osconfig.v1.IListInventoriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListInventoriesRequest, + | protos.google.cloud.osconfig.v1.IListInventoriesResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IInventory + > + ): void; + listInventories( + request: protos.google.cloud.osconfig.v1.IListInventoriesRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListInventoriesRequest, + | protos.google.cloud.osconfig.v1.IListInventoriesResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IInventory + > + ): void; + listInventories( + request?: protos.google.cloud.osconfig.v1.IListInventoriesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1.IListInventoriesRequest, + | protos.google.cloud.osconfig.v1.IListInventoriesResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IInventory + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1.IListInventoriesRequest, + | protos.google.cloud.osconfig.v1.IListInventoriesResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IInventory + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IInventory[], + protos.google.cloud.osconfig.v1.IListInventoriesRequest | null, + protos.google.cloud.osconfig.v1.IListInventoriesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listInventories(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}/instances/-` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * @param {google.cloud.osconfig.v1.InventoryView} request.view + * Inventory view indicating what information should be included in the + * inventory resource. If unspecified, the default view is BASIC. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListInventories` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `Inventory` API resource to be included in the response. + * @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 [Inventory]{@link google.cloud.osconfig.v1.Inventory} 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 `listInventoriesAsync()` + * 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. + */ + listInventoriesStream( + request?: protos.google.cloud.osconfig.v1.IListInventoriesRequest, + 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['listInventories']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInventories.createStream( + this.innerApiCalls.listInventories as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listInventories`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}/instances/-` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * @param {google.cloud.osconfig.v1.InventoryView} request.view + * Inventory view indicating what information should be included in the + * inventory resource. If unspecified, the default view is BASIC. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListInventories` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `Inventory` API resource to be included in the response. + * @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 + * [Inventory]{@link google.cloud.osconfig.v1.Inventory}. 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/os_config_zonal_service.list_inventories.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_ListInventories_async + */ + listInventoriesAsync( + request?: protos.google.cloud.osconfig.v1.IListInventoriesRequest, + 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['listInventories']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInventories.asyncIterate( + this.innerApiCalls['listInventories'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List vulnerability reports for all VM instances in the specified zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}/instances/-` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListVulnerabilityReports` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `vulnerabilityReport` API resource to be included in the response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [VulnerabilityReport]{@link google.cloud.osconfig.v1.VulnerabilityReport}. + * 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 `listVulnerabilityReportsAsync()` + * 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. + */ + listVulnerabilityReports( + request?: protos.google.cloud.osconfig.v1.IListVulnerabilityReportsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1.IVulnerabilityReport[], + protos.google.cloud.osconfig.v1.IListVulnerabilityReportsRequest | null, + protos.google.cloud.osconfig.v1.IListVulnerabilityReportsResponse + ] + >; + listVulnerabilityReports( + request: protos.google.cloud.osconfig.v1.IListVulnerabilityReportsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListVulnerabilityReportsRequest, + | protos.google.cloud.osconfig.v1.IListVulnerabilityReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IVulnerabilityReport + > + ): void; + listVulnerabilityReports( + request: protos.google.cloud.osconfig.v1.IListVulnerabilityReportsRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1.IListVulnerabilityReportsRequest, + | protos.google.cloud.osconfig.v1.IListVulnerabilityReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IVulnerabilityReport + > + ): void; + listVulnerabilityReports( + request?: protos.google.cloud.osconfig.v1.IListVulnerabilityReportsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1.IListVulnerabilityReportsRequest, + | protos.google.cloud.osconfig.v1.IListVulnerabilityReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IVulnerabilityReport + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1.IListVulnerabilityReportsRequest, + | protos.google.cloud.osconfig.v1.IListVulnerabilityReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1.IVulnerabilityReport + > + ): Promise< + [ + protos.google.cloud.osconfig.v1.IVulnerabilityReport[], + protos.google.cloud.osconfig.v1.IListVulnerabilityReportsRequest | null, + protos.google.cloud.osconfig.v1.IListVulnerabilityReportsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listVulnerabilityReports( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}/instances/-` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListVulnerabilityReports` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `vulnerabilityReport` API resource to be included in the response. + * @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 [VulnerabilityReport]{@link google.cloud.osconfig.v1.VulnerabilityReport} 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 `listVulnerabilityReportsAsync()` + * 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. + */ + listVulnerabilityReportsStream( + request?: protos.google.cloud.osconfig.v1.IListVulnerabilityReportsRequest, + 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['listVulnerabilityReports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVulnerabilityReports.createStream( + this.innerApiCalls.listVulnerabilityReports as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listVulnerabilityReports`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}/instances/-` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListVulnerabilityReports` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `vulnerabilityReport` API resource to be included in the response. + * @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 + * [VulnerabilityReport]{@link google.cloud.osconfig.v1.VulnerabilityReport}. 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/os_config_zonal_service.list_vulnerability_reports.js + * region_tag:osconfig_v1_generated_OsConfigZonalService_ListVulnerabilityReports_async + */ + listVulnerabilityReportsAsync( + request?: protos.google.cloud.osconfig.v1.IListVulnerabilityReportsRequest, + 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['listVulnerabilityReports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVulnerabilityReports.asyncIterate( + this.innerApiCalls['listVulnerabilityReports'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified inventory resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + inventoryPath(project: string, location: string, instance: string) { + return this.pathTemplates.inventoryPathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .project; + } + + /** + * Parse the location from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .location; + } + + /** + * Parse the instance from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .instance; + } + + /** + * Return a fully-qualified oSPolicyAssignment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} os_policy_assignment + * @returns {string} Resource name string. + */ + oSPolicyAssignmentPath( + project: string, + location: string, + osPolicyAssignment: string + ) { + return this.pathTemplates.oSPolicyAssignmentPathTemplate.render({ + project: project, + location: location, + os_policy_assignment: osPolicyAssignment, + }); + } + + /** + * Parse the project from OSPolicyAssignment resource. + * + * @param {string} oSPolicyAssignmentName + * A fully-qualified path representing OSPolicyAssignment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOSPolicyAssignmentName(oSPolicyAssignmentName: string) { + return this.pathTemplates.oSPolicyAssignmentPathTemplate.match( + oSPolicyAssignmentName + ).project; + } + + /** + * Parse the location from OSPolicyAssignment resource. + * + * @param {string} oSPolicyAssignmentName + * A fully-qualified path representing OSPolicyAssignment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOSPolicyAssignmentName(oSPolicyAssignmentName: string) { + return this.pathTemplates.oSPolicyAssignmentPathTemplate.match( + oSPolicyAssignmentName + ).location; + } + + /** + * Parse the os_policy_assignment from OSPolicyAssignment resource. + * + * @param {string} oSPolicyAssignmentName + * A fully-qualified path representing OSPolicyAssignment resource. + * @returns {string} A string representing the os_policy_assignment. + */ + matchOsPolicyAssignmentFromOSPolicyAssignmentName( + oSPolicyAssignmentName: string + ) { + return this.pathTemplates.oSPolicyAssignmentPathTemplate.match( + oSPolicyAssignmentName + ).os_policy_assignment; + } + + /** + * Return a fully-qualified oSPolicyAssignmentReport resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @param {string} assignment + * @returns {string} Resource name string. + */ + oSPolicyAssignmentReportPath( + project: string, + location: string, + instance: string, + assignment: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.render({ + project: project, + location: location, + instance: instance, + assignment: assignment, + }); + } + + /** + * Parse the project from OSPolicyAssignmentReport resource. + * + * @param {string} oSPolicyAssignmentReportName + * A fully-qualified path representing OSPolicyAssignmentReport resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOSPolicyAssignmentReportName( + oSPolicyAssignmentReportName: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.match( + oSPolicyAssignmentReportName + ).project; + } + + /** + * Parse the location from OSPolicyAssignmentReport resource. + * + * @param {string} oSPolicyAssignmentReportName + * A fully-qualified path representing OSPolicyAssignmentReport resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOSPolicyAssignmentReportName( + oSPolicyAssignmentReportName: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.match( + oSPolicyAssignmentReportName + ).location; + } + + /** + * Parse the instance from OSPolicyAssignmentReport resource. + * + * @param {string} oSPolicyAssignmentReportName + * A fully-qualified path representing OSPolicyAssignmentReport resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromOSPolicyAssignmentReportName( + oSPolicyAssignmentReportName: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.match( + oSPolicyAssignmentReportName + ).instance; + } + + /** + * Parse the assignment from OSPolicyAssignmentReport resource. + * + * @param {string} oSPolicyAssignmentReportName + * A fully-qualified path representing OSPolicyAssignmentReport resource. + * @returns {string} A string representing the assignment. + */ + matchAssignmentFromOSPolicyAssignmentReportName( + oSPolicyAssignmentReportName: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.match( + oSPolicyAssignmentReportName + ).assignment; + } + + /** + * Return a fully-qualified patchDeployment resource name string. + * + * @param {string} project + * @param {string} patch_deployment + * @returns {string} Resource name string. + */ + patchDeploymentPath(project: string, patchDeployment: string) { + return this.pathTemplates.patchDeploymentPathTemplate.render({ + project: project, + patch_deployment: patchDeployment, + }); + } + + /** + * Parse the project from PatchDeployment resource. + * + * @param {string} patchDeploymentName + * A fully-qualified path representing PatchDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPatchDeploymentName(patchDeploymentName: string) { + return this.pathTemplates.patchDeploymentPathTemplate.match( + patchDeploymentName + ).project; + } + + /** + * Parse the patch_deployment from PatchDeployment resource. + * + * @param {string} patchDeploymentName + * A fully-qualified path representing PatchDeployment resource. + * @returns {string} A string representing the patch_deployment. + */ + matchPatchDeploymentFromPatchDeploymentName(patchDeploymentName: string) { + return this.pathTemplates.patchDeploymentPathTemplate.match( + patchDeploymentName + ).patch_deployment; + } + + /** + * Return a fully-qualified patchJob resource name string. + * + * @param {string} project + * @param {string} patch_job + * @returns {string} Resource name string. + */ + patchJobPath(project: string, patchJob: string) { + return this.pathTemplates.patchJobPathTemplate.render({ + project: project, + patch_job: patchJob, + }); + } + + /** + * Parse the project from PatchJob resource. + * + * @param {string} patchJobName + * A fully-qualified path representing PatchJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPatchJobName(patchJobName: string) { + return this.pathTemplates.patchJobPathTemplate.match(patchJobName).project; + } + + /** + * Parse the patch_job from PatchJob resource. + * + * @param {string} patchJobName + * A fully-qualified path representing PatchJob resource. + * @returns {string} A string representing the patch_job. + */ + matchPatchJobFromPatchJobName(patchJobName: string) { + return this.pathTemplates.patchJobPathTemplate.match(patchJobName) + .patch_job; + } + + /** + * Return a fully-qualified vulnerabilityReport resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + vulnerabilityReportPath(project: string, location: string, instance: string) { + return this.pathTemplates.vulnerabilityReportPathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from VulnerabilityReport resource. + * + * @param {string} vulnerabilityReportName + * A fully-qualified path representing VulnerabilityReport resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVulnerabilityReportName(vulnerabilityReportName: string) { + return this.pathTemplates.vulnerabilityReportPathTemplate.match( + vulnerabilityReportName + ).project; + } + + /** + * Parse the location from VulnerabilityReport resource. + * + * @param {string} vulnerabilityReportName + * A fully-qualified path representing VulnerabilityReport resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVulnerabilityReportName(vulnerabilityReportName: string) { + return this.pathTemplates.vulnerabilityReportPathTemplate.match( + vulnerabilityReportName + ).location; + } + + /** + * Parse the instance from VulnerabilityReport resource. + * + * @param {string} vulnerabilityReportName + * A fully-qualified path representing VulnerabilityReport resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromVulnerabilityReportName(vulnerabilityReportName: string) { + return this.pathTemplates.vulnerabilityReportPathTemplate.match( + vulnerabilityReportName + ).instance; + } + + /** + * 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.osConfigZonalServiceStub && !this._terminated) { + return this.osConfigZonalServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-osconfig/src/v1/os_config_zonal_service_client_config.json b/packages/google-cloud-osconfig/src/v1/os_config_zonal_service_client_config.json new file mode 100644 index 00000000000..bb97e593101 --- /dev/null +++ b/packages/google-cloud-osconfig/src/v1/os_config_zonal_service_client_config.json @@ -0,0 +1,98 @@ +{ + "interfaces": { + "google.cloud.osconfig.v1.OsConfigZonalService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { + "initial_retry_delay_millis": 1000, + "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": { + "CreateOSPolicyAssignment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateOSPolicyAssignment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetOSPolicyAssignment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListOSPolicyAssignments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListOSPolicyAssignmentRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteOSPolicyAssignment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetOSPolicyAssignmentReport": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListOSPolicyAssignmentReports": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetInventory": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListInventories": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetVulnerabilityReport": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListVulnerabilityReports": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + } + } + } + } +} diff --git a/packages/google-cloud-osconfig/src/v1/os_config_zonal_service_proto_list.json b/packages/google-cloud-osconfig/src/v1/os_config_zonal_service_proto_list.json new file mode 100644 index 00000000000..e074f70ca02 --- /dev/null +++ b/packages/google-cloud-osconfig/src/v1/os_config_zonal_service_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/osconfig/v1/inventory.proto", + "../../protos/google/cloud/osconfig/v1/os_policy.proto", + "../../protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto", + "../../protos/google/cloud/osconfig/v1/os_policy_assignments.proto", + "../../protos/google/cloud/osconfig/v1/osconfig_common.proto", + "../../protos/google/cloud/osconfig/v1/osconfig_service.proto", + "../../protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto", + "../../protos/google/cloud/osconfig/v1/patch_deployments.proto", + "../../protos/google/cloud/osconfig/v1/patch_jobs.proto", + "../../protos/google/cloud/osconfig/v1/vulnerability.proto" +] diff --git a/packages/google-cloud-osconfig/src/v1alpha/gapic_metadata.json b/packages/google-cloud-osconfig/src/v1alpha/gapic_metadata.json new file mode 100644 index 00000000000..014b66375b8 --- /dev/null +++ b/packages/google-cloud-osconfig/src/v1alpha/gapic_metadata.json @@ -0,0 +1,187 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.osconfig.v1alpha", + "libraryPackage": "@google-cloud/os-config", + "services": { + "OsConfigZonalService": { + "clients": { + "grpc": { + "libraryClient": "OsConfigZonalServiceClient", + "rpcs": { + "GetOSPolicyAssignment": { + "methods": [ + "getOSPolicyAssignment" + ] + }, + "GetInstanceOSPoliciesCompliance": { + "methods": [ + "getInstanceOSPoliciesCompliance" + ] + }, + "GetOSPolicyAssignmentReport": { + "methods": [ + "getOSPolicyAssignmentReport" + ] + }, + "GetInventory": { + "methods": [ + "getInventory" + ] + }, + "GetVulnerabilityReport": { + "methods": [ + "getVulnerabilityReport" + ] + }, + "CreateOSPolicyAssignment": { + "methods": [ + "createOSPolicyAssignment" + ] + }, + "UpdateOSPolicyAssignment": { + "methods": [ + "updateOSPolicyAssignment" + ] + }, + "DeleteOSPolicyAssignment": { + "methods": [ + "deleteOSPolicyAssignment" + ] + }, + "ListOSPolicyAssignments": { + "methods": [ + "listOSPolicyAssignments", + "listOSPolicyAssignmentsStream", + "listOSPolicyAssignmentsAsync" + ] + }, + "ListOSPolicyAssignmentRevisions": { + "methods": [ + "listOSPolicyAssignmentRevisions", + "listOSPolicyAssignmentRevisionsStream", + "listOSPolicyAssignmentRevisionsAsync" + ] + }, + "ListInstanceOSPoliciesCompliances": { + "methods": [ + "listInstanceOSPoliciesCompliances", + "listInstanceOSPoliciesCompliancesStream", + "listInstanceOSPoliciesCompliancesAsync" + ] + }, + "ListOSPolicyAssignmentReports": { + "methods": [ + "listOSPolicyAssignmentReports", + "listOSPolicyAssignmentReportsStream", + "listOSPolicyAssignmentReportsAsync" + ] + }, + "ListInventories": { + "methods": [ + "listInventories", + "listInventoriesStream", + "listInventoriesAsync" + ] + }, + "ListVulnerabilityReports": { + "methods": [ + "listVulnerabilityReports", + "listVulnerabilityReportsStream", + "listVulnerabilityReportsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "OsConfigZonalServiceClient", + "rpcs": { + "GetOSPolicyAssignment": { + "methods": [ + "getOSPolicyAssignment" + ] + }, + "GetInstanceOSPoliciesCompliance": { + "methods": [ + "getInstanceOSPoliciesCompliance" + ] + }, + "GetOSPolicyAssignmentReport": { + "methods": [ + "getOSPolicyAssignmentReport" + ] + }, + "GetInventory": { + "methods": [ + "getInventory" + ] + }, + "GetVulnerabilityReport": { + "methods": [ + "getVulnerabilityReport" + ] + }, + "CreateOSPolicyAssignment": { + "methods": [ + "createOSPolicyAssignment" + ] + }, + "UpdateOSPolicyAssignment": { + "methods": [ + "updateOSPolicyAssignment" + ] + }, + "DeleteOSPolicyAssignment": { + "methods": [ + "deleteOSPolicyAssignment" + ] + }, + "ListOSPolicyAssignments": { + "methods": [ + "listOSPolicyAssignments", + "listOSPolicyAssignmentsStream", + "listOSPolicyAssignmentsAsync" + ] + }, + "ListOSPolicyAssignmentRevisions": { + "methods": [ + "listOSPolicyAssignmentRevisions", + "listOSPolicyAssignmentRevisionsStream", + "listOSPolicyAssignmentRevisionsAsync" + ] + }, + "ListInstanceOSPoliciesCompliances": { + "methods": [ + "listInstanceOSPoliciesCompliances", + "listInstanceOSPoliciesCompliancesStream", + "listInstanceOSPoliciesCompliancesAsync" + ] + }, + "ListOSPolicyAssignmentReports": { + "methods": [ + "listOSPolicyAssignmentReports", + "listOSPolicyAssignmentReportsStream", + "listOSPolicyAssignmentReportsAsync" + ] + }, + "ListInventories": { + "methods": [ + "listInventories", + "listInventoriesStream", + "listInventoriesAsync" + ] + }, + "ListVulnerabilityReports": { + "methods": [ + "listVulnerabilityReports", + "listVulnerabilityReportsStream", + "listVulnerabilityReportsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-osconfig/src/v1alpha/index.ts b/packages/google-cloud-osconfig/src/v1alpha/index.ts new file mode 100644 index 00000000000..d1d2e1561eb --- /dev/null +++ b/packages/google-cloud-osconfig/src/v1alpha/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {OsConfigZonalServiceClient} from './os_config_zonal_service_client'; diff --git a/packages/google-cloud-osconfig/src/v1alpha/os_config_zonal_service_client.ts b/packages/google-cloud-osconfig/src/v1alpha/os_config_zonal_service_client.ts new file mode 100644 index 00000000000..9390a9178db --- /dev/null +++ b/packages/google-cloud-osconfig/src/v1alpha/os_config_zonal_service_client.ts @@ -0,0 +1,3168 @@ +// 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/v1alpha/os_config_zonal_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './os_config_zonal_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Zonal OS Config API + * + * The OS Config service is the server-side component that allows users to + * manage package installations and patch jobs for Compute Engine VM instances. + * @class + * @memberof v1alpha + */ +export class OsConfigZonalServiceClient { + 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; + osConfigZonalServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of OsConfigZonalServiceClient. + * + * @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 OsConfigZonalServiceClient({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 OsConfigZonalServiceClient; + 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 = { + instanceOSPoliciesCompliancePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instanceOSPoliciesCompliances/{instance}' + ), + inventoryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/inventory' + ), + oSPolicyAssignmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}' + ), + oSPolicyAssignmentReportPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report' + ), + vulnerabilityReportPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport' + ), + }; + + // 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 = { + listOSPolicyAssignments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'osPolicyAssignments' + ), + listOSPolicyAssignmentRevisions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'osPolicyAssignments' + ), + listInstanceOSPoliciesCompliances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'instanceOsPoliciesCompliances' + ), + listOSPolicyAssignmentReports: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'osPolicyAssignmentReports' + ), + listInventories: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'inventories' + ), + listVulnerabilityReports: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'vulnerabilityReports' + ), + }; + + 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: '/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*/operations/*}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createOSPolicyAssignmentResponse = protoFilesRoot.lookup( + '.google.cloud.osconfig.v1alpha.OSPolicyAssignment' + ) as gax.protobuf.Type; + const createOSPolicyAssignmentMetadata = protoFilesRoot.lookup( + '.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata' + ) as gax.protobuf.Type; + const updateOSPolicyAssignmentResponse = protoFilesRoot.lookup( + '.google.cloud.osconfig.v1alpha.OSPolicyAssignment' + ) as gax.protobuf.Type; + const updateOSPolicyAssignmentMetadata = protoFilesRoot.lookup( + '.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata' + ) as gax.protobuf.Type; + const deleteOSPolicyAssignmentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteOSPolicyAssignmentMetadata = protoFilesRoot.lookup( + '.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createOSPolicyAssignment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createOSPolicyAssignmentResponse.decode.bind( + createOSPolicyAssignmentResponse + ), + createOSPolicyAssignmentMetadata.decode.bind( + createOSPolicyAssignmentMetadata + ) + ), + updateOSPolicyAssignment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateOSPolicyAssignmentResponse.decode.bind( + updateOSPolicyAssignmentResponse + ), + updateOSPolicyAssignmentMetadata.decode.bind( + updateOSPolicyAssignmentMetadata + ) + ), + deleteOSPolicyAssignment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteOSPolicyAssignmentResponse.decode.bind( + deleteOSPolicyAssignmentResponse + ), + deleteOSPolicyAssignmentMetadata.decode.bind( + deleteOSPolicyAssignmentMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.osconfig.v1alpha.OsConfigZonalService', + 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.osConfigZonalServiceStub) { + return this.osConfigZonalServiceStub; + } + + // Put together the "service stub" for + // google.cloud.osconfig.v1alpha.OsConfigZonalService. + this.osConfigZonalServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.osconfig.v1alpha.OsConfigZonalService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.osconfig.v1alpha + .OsConfigZonalService, + 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 osConfigZonalServiceStubMethods = [ + 'createOsPolicyAssignment', + 'updateOsPolicyAssignment', + 'getOsPolicyAssignment', + 'listOsPolicyAssignments', + 'listOsPolicyAssignmentRevisions', + 'deleteOsPolicyAssignment', + 'getInstanceOsPoliciesCompliance', + 'listInstanceOsPoliciesCompliances', + 'getOsPolicyAssignmentReport', + 'listOsPolicyAssignmentReports', + 'getInventory', + 'listInventories', + 'getVulnerabilityReport', + 'listVulnerabilityReports', + ]; + for (const methodName of osConfigZonalServiceStubMethods) { + const callPromise = this.osConfigZonalServiceStub.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.osConfigZonalServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'osconfig.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 'osconfig.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 -- + // ------------------- + /** + * Retrieve an existing OS policy assignment. + * + * This method always returns the latest revision. In order to retrieve a + * previous revision of the assignment, also provide the revision ID in the + * `name` parameter. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of OS policy assignment. + * + * Format: + * `projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}@{revisionId}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OSPolicyAssignment]{@link google.cloud.osconfig.v1alpha.OSPolicyAssignment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignment_async + */ + getOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + ( + | protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest + | undefined + ), + {} | undefined + ] + >; + getOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + | protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest, + callback: Callback< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + | protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + | protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + | protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + ( + | protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getOsPolicyAssignment(request, options, callback); + } + /** + * Get OS policies compliance data for the specified Compute Engine VM + * instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. API resource name for instance OS policies compliance resource. + * + * Format: + * `projects/{project}/locations/{location}/instanceOSPoliciesCompliances/{instance}` + * + * For `{project}`, either Compute Engine project-number or project-id can be + * provided. + * For `{instance}`, either Compute Engine VM instance-id or instance-name can + * be provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [InstanceOSPoliciesCompliance]{@link google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/os_config_zonal_service.get_instance_o_s_policies_compliance.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_GetInstanceOSPoliciesCompliance_async + * @deprecated GetInstanceOSPoliciesCompliance is deprecated and may be removed in a future version. + */ + getInstanceOSPoliciesCompliance( + request?: protos.google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance, + ( + | protos.google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest + | undefined + ), + {} | undefined + ] + >; + getInstanceOSPoliciesCompliance( + request: protos.google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance, + | protos.google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstanceOSPoliciesCompliance( + request: protos.google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest, + callback: Callback< + protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance, + | protos.google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstanceOSPoliciesCompliance( + request?: protos.google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance, + | protos.google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance, + | protos.google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance, + ( + | protos.google.cloud.osconfig.v1alpha.IGetInstanceOSPoliciesComplianceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + this.warn( + 'DEP$OsConfigZonalService-$GetInstanceOSPoliciesCompliance', + 'GetInstanceOSPoliciesCompliance is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); + return this.innerApiCalls.getInstanceOsPoliciesCompliance( + request, + options, + callback + ); + } + /** + * Get the OS policy asssignment report for the specified Compute Engine VM + * instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. API resource name for OS policy assignment report. + * + * Format: + * `/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance_id}`, either Compute Engine `instance-id` or `instance-name` + * can be provided. + * For `{assignment_id}`, the OSPolicyAssignment id must be provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OSPolicyAssignmentReport]{@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/os_config_zonal_service.get_o_s_policy_assignment_report.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async + */ + getOSPolicyAssignmentReport( + request?: protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport, + ( + | protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest + | undefined + ), + {} | undefined + ] + >; + getOSPolicyAssignmentReport( + request: protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport, + | protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOSPolicyAssignmentReport( + request: protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest, + callback: Callback< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport, + | protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOSPolicyAssignmentReport( + request?: protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport, + | protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport, + | protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport, + ( + | protos.google.cloud.osconfig.v1alpha.IGetOSPolicyAssignmentReportRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getOsPolicyAssignmentReport( + request, + options, + callback + ); + } + /** + * Get inventory data for the specified VM instance. If the VM has no + * associated inventory, the message `NOT_FOUND` is returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. API resource name for inventory resource. + * + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/inventory` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either Compute Engine `instance-id` or `instance-name` + * can be provided. + * @param {google.cloud.osconfig.v1alpha.InventoryView} request.view + * Inventory view indicating what information should be included in the + * inventory resource. If unspecified, the default view is BASIC. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Inventory]{@link google.cloud.osconfig.v1alpha.Inventory}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/os_config_zonal_service.get_inventory.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_GetInventory_async + */ + getInventory( + request?: protos.google.cloud.osconfig.v1alpha.IGetInventoryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IInventory, + protos.google.cloud.osconfig.v1alpha.IGetInventoryRequest | undefined, + {} | undefined + ] + >; + getInventory( + request: protos.google.cloud.osconfig.v1alpha.IGetInventoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1alpha.IInventory, + | protos.google.cloud.osconfig.v1alpha.IGetInventoryRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInventory( + request: protos.google.cloud.osconfig.v1alpha.IGetInventoryRequest, + callback: Callback< + protos.google.cloud.osconfig.v1alpha.IInventory, + | protos.google.cloud.osconfig.v1alpha.IGetInventoryRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInventory( + request?: protos.google.cloud.osconfig.v1alpha.IGetInventoryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1alpha.IInventory, + | protos.google.cloud.osconfig.v1alpha.IGetInventoryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1alpha.IInventory, + | protos.google.cloud.osconfig.v1alpha.IGetInventoryRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IInventory, + protos.google.cloud.osconfig.v1alpha.IGetInventoryRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getInventory(request, options, callback); + } + /** + * Gets the vulnerability report for the specified VM instance. Only VMs with + * inventory data have vulnerability reports associated with them. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. API resource name for vulnerability resource. + * + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either Compute Engine `instance-id` or `instance-name` + * can be provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [VulnerabilityReport]{@link google.cloud.osconfig.v1alpha.VulnerabilityReport}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/os_config_zonal_service.get_vulnerability_report.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_GetVulnerabilityReport_async + */ + getVulnerabilityReport( + request?: protos.google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport, + ( + | protos.google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest + | undefined + ), + {} | undefined + ] + >; + getVulnerabilityReport( + request: protos.google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport, + | protos.google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getVulnerabilityReport( + request: protos.google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest, + callback: Callback< + protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport, + | protos.google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getVulnerabilityReport( + request?: protos.google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport, + | protos.google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport, + | protos.google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport, + ( + | protos.google.cloud.osconfig.v1alpha.IGetVulnerabilityReportRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getVulnerabilityReport( + request, + options, + callback + ); + } + + /** + * Create an OS policy assignment. + * + * This method also creates the first revision of the OS policy assignment. + * + * This method returns a long running operation (LRO) that contains the + * rollout details. The rollout can be cancelled by cancelling the LRO. + * + * For more information, see [Method: + * projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name in the form: + * projects/{project}/locations/{location} + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment} request.osPolicyAssignment + * Required. The OS policy assignment to be created. + * @param {string} request.osPolicyAssignmentId + * Required. The logical name of the OS policy assignment in the project + * with the following restrictions: + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the project. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/v1alpha/os_config_zonal_service.create_o_s_policy_assignment.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_CreateOSPolicyAssignment_async + */ + createOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest, + callback: Callback< + LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1alpha.ICreateOSPolicyAssignmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + 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.createOsPolicyAssignment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createOSPolicyAssignment()`. + * @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/v1alpha/os_config_zonal_service.create_o_s_policy_assignment.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_CreateOSPolicyAssignment_async + */ + async checkCreateOSPolicyAssignmentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + > + > { + 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.createOSPolicyAssignment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + >; + } + /** + * Update an existing OS policy assignment. + * + * This method creates a new revision of the OS policy assignment. + * + * This method returns a long running operation (LRO) that contains the + * rollout details. The rollout can be cancelled by cancelling the LRO. + * + * For more information, see [Method: + * projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.osconfig.v1alpha.OSPolicyAssignment} request.osPolicyAssignment + * Required. The updated OS policy assignment. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask that controls which fields of the assignment should 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 + * 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/v1alpha/os_config_zonal_service.update_o_s_policy_assignment.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async + */ + updateOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest, + callback: Callback< + LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1alpha.IUpdateOSPolicyAssignmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + 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({ + 'os_policy_assignment.name': request.osPolicyAssignment!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateOsPolicyAssignment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateOSPolicyAssignment()`. + * @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/v1alpha/os_config_zonal_service.update_o_s_policy_assignment.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async + */ + async checkUpdateOSPolicyAssignmentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + > + > { + 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.updateOSPolicyAssignment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + >; + } + /** + * Delete the OS policy assignment. + * + * This method creates a new revision of the OS policy assignment. + * + * This method returns a long running operation (LRO) that contains the + * rollout details. The rollout can be cancelled by cancelling the LRO. + * + * If the LRO completes and is not cancelled, all revisions associated with + * the OS policy assignment are deleted. + * + * For more information, see [Method: + * projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the OS policy assignment to be deleted + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1alpha/os_config_zonal_service.delete_o_s_policy_assignment.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async + */ + deleteOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteOSPolicyAssignment( + request: protos.google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteOSPolicyAssignment( + request?: protos.google.cloud.osconfig.v1alpha.IDeleteOSPolicyAssignmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteOsPolicyAssignment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteOSPolicyAssignment()`. + * @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/v1alpha/os_config_zonal_service.delete_o_s_policy_assignment.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async + */ + async checkDeleteOSPolicyAssignmentProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + > + > { + 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.deleteOSPolicyAssignment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentOperationMetadata + >; + } + /** + * List the OS policy assignments under the parent resource. + * + * For each OS policy assignment, the latest revision is returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * @param {number} request.pageSize + * The maximum number of assignments to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListOSPolicyAssignments` that indicates where this listing should continue + * from. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [OSPolicyAssignment]{@link google.cloud.osconfig.v1alpha.OSPolicyAssignment}. + * 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 `listOSPolicyAssignmentsAsync()` + * 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. + */ + listOSPolicyAssignments( + request?: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment[], + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest | null, + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse + ] + >; + listOSPolicyAssignments( + request: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest, + | protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment + > + ): void; + listOSPolicyAssignments( + request: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest, + | protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment + > + ): void; + listOSPolicyAssignments( + request?: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest, + | protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest, + | protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment + > + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment[], + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest | null, + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listOsPolicyAssignments( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * @param {number} request.pageSize + * The maximum number of assignments to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListOSPolicyAssignments` that indicates where this listing should continue + * from. + * @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 [OSPolicyAssignment]{@link google.cloud.osconfig.v1alpha.OSPolicyAssignment} 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 `listOSPolicyAssignmentsAsync()` + * 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. + */ + listOSPolicyAssignmentsStream( + request?: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest, + 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['listOsPolicyAssignments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOSPolicyAssignments.createStream( + this.innerApiCalls.listOsPolicyAssignments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listOSPolicyAssignments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * @param {number} request.pageSize + * The maximum number of assignments to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListOSPolicyAssignments` that indicates where this listing should continue + * from. + * @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 + * [OSPolicyAssignment]{@link google.cloud.osconfig.v1alpha.OSPolicyAssignment}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignments.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignments_async + */ + listOSPolicyAssignmentsAsync( + request?: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentsRequest, + 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['listOsPolicyAssignments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOSPolicyAssignments.asyncIterate( + this.innerApiCalls['listOsPolicyAssignments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List the OS policy assignment revisions for a given OS policy assignment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the OS policy assignment to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListOSPolicyAssignmentRevisions` that indicates where this listing should + * continue from. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [OSPolicyAssignment]{@link google.cloud.osconfig.v1alpha.OSPolicyAssignment}. + * 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 `listOSPolicyAssignmentRevisionsAsync()` + * 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. + */ + listOSPolicyAssignmentRevisions( + request?: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment[], + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest | null, + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse + ] + >; + listOSPolicyAssignmentRevisions( + request: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest, + | protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment + > + ): void; + listOSPolicyAssignmentRevisions( + request: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest, + | protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment + > + ): void; + listOSPolicyAssignmentRevisions( + request?: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest, + | protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest, + | protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment + > + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment[], + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest | null, + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.listOsPolicyAssignmentRevisions( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the OS policy assignment to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListOSPolicyAssignmentRevisions` that indicates where this listing should + * continue from. + * @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 [OSPolicyAssignment]{@link google.cloud.osconfig.v1alpha.OSPolicyAssignment} 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 `listOSPolicyAssignmentRevisionsAsync()` + * 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. + */ + listOSPolicyAssignmentRevisionsStream( + request?: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + const defaultCallSettings = + this._defaults['listOsPolicyAssignmentRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOSPolicyAssignmentRevisions.createStream( + this.innerApiCalls.listOsPolicyAssignmentRevisions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listOSPolicyAssignmentRevisions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the OS policy assignment to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListOSPolicyAssignmentRevisions` that indicates where this listing should + * continue from. + * @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 + * [OSPolicyAssignment]{@link google.cloud.osconfig.v1alpha.OSPolicyAssignment}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_revisions.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async + */ + listOSPolicyAssignmentRevisionsAsync( + request?: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentRevisionsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + const defaultCallSettings = + this._defaults['listOsPolicyAssignmentRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOSPolicyAssignmentRevisions.asyncIterate( + this.innerApiCalls['listOsPolicyAssignmentRevisions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List OS policies compliance data for all Compute Engine VM instances in the + * specified zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}` + * + * For `{project}`, either Compute Engine project-number or project-id can be + * provided. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListInstanceOSPoliciesCompliances` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `InstanceOSPoliciesCompliance` API resource to be included in the response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [InstanceOSPoliciesCompliance]{@link google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance}. + * 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 `listInstanceOSPoliciesCompliancesAsync()` + * 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. + * @deprecated ListInstanceOSPoliciesCompliances is deprecated and may be removed in a future version. + */ + listInstanceOSPoliciesCompliances( + request?: protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance[], + protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest | null, + protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse + ] + >; + listInstanceOSPoliciesCompliances( + request: protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest, + | protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance + > + ): void; + listInstanceOSPoliciesCompliances( + request: protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest, + | protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance + > + ): void; + listInstanceOSPoliciesCompliances( + request?: protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest, + | protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest, + | protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance + > + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance[], + protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest | null, + protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + this.warn( + 'DEP$OsConfigZonalService-$ListInstanceOSPoliciesCompliances', + 'ListInstanceOSPoliciesCompliances is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); + return this.innerApiCalls.listInstanceOsPoliciesCompliances( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}` + * + * For `{project}`, either Compute Engine project-number or project-id can be + * provided. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListInstanceOSPoliciesCompliances` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `InstanceOSPoliciesCompliance` API resource to be included in the response. + * @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 [InstanceOSPoliciesCompliance]{@link google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance} 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 `listInstanceOSPoliciesCompliancesAsync()` + * 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. + * @deprecated ListInstanceOSPoliciesCompliances is deprecated and may be removed in a future version. + */ + listInstanceOSPoliciesCompliancesStream( + request?: protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest, + 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['listInstanceOsPoliciesCompliances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this.warn( + 'DEP$OsConfigZonalService-$ListInstanceOSPoliciesCompliances', + 'ListInstanceOSPoliciesCompliances is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); + return this.descriptors.page.listInstanceOSPoliciesCompliances.createStream( + this.innerApiCalls.listInstanceOsPoliciesCompliances as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listInstanceOSPoliciesCompliances`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}` + * + * For `{project}`, either Compute Engine project-number or project-id can be + * provided. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListInstanceOSPoliciesCompliances` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `InstanceOSPoliciesCompliance` API resource to be included in the response. + * @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 + * [InstanceOSPoliciesCompliance]{@link google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/os_config_zonal_service.list_instance_o_s_policies_compliances.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_ListInstanceOSPoliciesCompliances_async + * @deprecated ListInstanceOSPoliciesCompliances is deprecated and may be removed in a future version. + */ + listInstanceOSPoliciesCompliancesAsync( + request?: protos.google.cloud.osconfig.v1alpha.IListInstanceOSPoliciesCompliancesRequest, + 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['listInstanceOsPoliciesCompliances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this.warn( + 'DEP$OsConfigZonalService-$ListInstanceOSPoliciesCompliances', + 'ListInstanceOSPoliciesCompliances is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); + return this.descriptors.page.listInstanceOSPoliciesCompliances.asyncIterate( + this.innerApiCalls['listInstanceOsPoliciesCompliances'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List OS policy asssignment reports for all Compute Engine VM instances in + * the specified zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + * provided. If '-' is provided, the response will include + * OSPolicyAssignmentReports for all instances in the project/location. + * For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + * is provided, the response will include OSPolicyAssignmentReports for all + * OSPolicyAssignments in the project/location. + * Either {instance} or {assignment} must be `-`. + * + * For example: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + * returns all reports for the instance + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + * returns all the reports for the given assignment across all instances. + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + * returns all the reports for all assignments across all instances. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by the + * `OSPolicyAssignmentReport` API resource that is included in the response. + * @param {string} request.pageToken + * A pagination token returned from a previous call to the + * `ListOSPolicyAssignmentReports` method that indicates where this listing + * should continue from. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [OSPolicyAssignmentReport]{@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport}. + * 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 `listOSPolicyAssignmentReportsAsync()` + * 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. + */ + listOSPolicyAssignmentReports( + request?: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport[], + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest | null, + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse + ] + >; + listOSPolicyAssignmentReports( + request: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest, + | protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport + > + ): void; + listOSPolicyAssignmentReports( + request: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest, + | protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport + > + ): void; + listOSPolicyAssignmentReports( + request?: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest, + | protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest, + | protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport + > + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport[], + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest | null, + protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listOsPolicyAssignmentReports( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + * provided. If '-' is provided, the response will include + * OSPolicyAssignmentReports for all instances in the project/location. + * For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + * is provided, the response will include OSPolicyAssignmentReports for all + * OSPolicyAssignments in the project/location. + * Either {instance} or {assignment} must be `-`. + * + * For example: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + * returns all reports for the instance + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + * returns all the reports for the given assignment across all instances. + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + * returns all the reports for all assignments across all instances. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by the + * `OSPolicyAssignmentReport` API resource that is included in the response. + * @param {string} request.pageToken + * A pagination token returned from a previous call to the + * `ListOSPolicyAssignmentReports` method that indicates where this listing + * should continue from. + * @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 [OSPolicyAssignmentReport]{@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport} 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 `listOSPolicyAssignmentReportsAsync()` + * 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. + */ + listOSPolicyAssignmentReportsStream( + request?: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest, + 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['listOsPolicyAssignmentReports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOSPolicyAssignmentReports.createStream( + this.innerApiCalls.listOsPolicyAssignmentReports as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listOSPolicyAssignmentReports`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + * provided. If '-' is provided, the response will include + * OSPolicyAssignmentReports for all instances in the project/location. + * For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + * is provided, the response will include OSPolicyAssignmentReports for all + * OSPolicyAssignments in the project/location. + * Either {instance} or {assignment} must be `-`. + * + * For example: + * `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + * returns all reports for the instance + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + * returns all the reports for the given assignment across all instances. + * `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + * returns all the reports for all assignments across all instances. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by the + * `OSPolicyAssignmentReport` API resource that is included in the response. + * @param {string} request.pageToken + * A pagination token returned from a previous call to the + * `ListOSPolicyAssignmentReports` method that indicates where this listing + * should continue from. + * @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 + * [OSPolicyAssignmentReport]{@link google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/os_config_zonal_service.list_o_s_policy_assignment_reports.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async + */ + listOSPolicyAssignmentReportsAsync( + request?: protos.google.cloud.osconfig.v1alpha.IListOSPolicyAssignmentReportsRequest, + 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['listOsPolicyAssignmentReports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOSPolicyAssignmentReports.asyncIterate( + this.innerApiCalls['listOsPolicyAssignmentReports'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List inventory data for all VM instances in the specified zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}/instances/-` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * @param {google.cloud.osconfig.v1alpha.InventoryView} request.view + * Inventory view indicating what information should be included in the + * inventory resource. If unspecified, the default view is BASIC. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListInventories` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `Inventory` API resource to be included in the response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Inventory]{@link google.cloud.osconfig.v1alpha.Inventory}. + * 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 `listInventoriesAsync()` + * 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. + */ + listInventories( + request?: protos.google.cloud.osconfig.v1alpha.IListInventoriesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IInventory[], + protos.google.cloud.osconfig.v1alpha.IListInventoriesRequest | null, + protos.google.cloud.osconfig.v1alpha.IListInventoriesResponse + ] + >; + listInventories( + request: protos.google.cloud.osconfig.v1alpha.IListInventoriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListInventoriesRequest, + | protos.google.cloud.osconfig.v1alpha.IListInventoriesResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IInventory + > + ): void; + listInventories( + request: protos.google.cloud.osconfig.v1alpha.IListInventoriesRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListInventoriesRequest, + | protos.google.cloud.osconfig.v1alpha.IListInventoriesResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IInventory + > + ): void; + listInventories( + request?: protos.google.cloud.osconfig.v1alpha.IListInventoriesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListInventoriesRequest, + | protos.google.cloud.osconfig.v1alpha.IListInventoriesResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IInventory + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListInventoriesRequest, + | protos.google.cloud.osconfig.v1alpha.IListInventoriesResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IInventory + > + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IInventory[], + protos.google.cloud.osconfig.v1alpha.IListInventoriesRequest | null, + protos.google.cloud.osconfig.v1alpha.IListInventoriesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listInventories(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}/instances/-` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * @param {google.cloud.osconfig.v1alpha.InventoryView} request.view + * Inventory view indicating what information should be included in the + * inventory resource. If unspecified, the default view is BASIC. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListInventories` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `Inventory` API resource to be included in the response. + * @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 [Inventory]{@link google.cloud.osconfig.v1alpha.Inventory} 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 `listInventoriesAsync()` + * 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. + */ + listInventoriesStream( + request?: protos.google.cloud.osconfig.v1alpha.IListInventoriesRequest, + 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['listInventories']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInventories.createStream( + this.innerApiCalls.listInventories as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listInventories`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}/instances/-` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * @param {google.cloud.osconfig.v1alpha.InventoryView} request.view + * Inventory view indicating what information should be included in the + * inventory resource. If unspecified, the default view is BASIC. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListInventories` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `Inventory` API resource to be included in the response. + * @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 + * [Inventory]{@link google.cloud.osconfig.v1alpha.Inventory}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/os_config_zonal_service.list_inventories.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_ListInventories_async + */ + listInventoriesAsync( + request?: protos.google.cloud.osconfig.v1alpha.IListInventoriesRequest, + 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['listInventories']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInventories.asyncIterate( + this.innerApiCalls['listInventories'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List vulnerability reports for all VM instances in the specified zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}/instances/-` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListVulnerabilityReports` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `vulnerabilityReport` API resource to be included in the response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [VulnerabilityReport]{@link google.cloud.osconfig.v1alpha.VulnerabilityReport}. + * 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 `listVulnerabilityReportsAsync()` + * 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. + */ + listVulnerabilityReports( + request?: protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport[], + protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest | null, + protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse + ] + >; + listVulnerabilityReports( + request: protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest, + | protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport + > + ): void; + listVulnerabilityReports( + request: protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest, + callback: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest, + | protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport + > + ): void; + listVulnerabilityReports( + request?: protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest, + | protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport + >, + callback?: PaginationCallback< + protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest, + | protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse + | null + | undefined, + protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport + > + ): Promise< + [ + protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport[], + protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest | null, + protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listVulnerabilityReports( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}/instances/-` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListVulnerabilityReports` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `vulnerabilityReport` API resource to be included in the response. + * @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 [VulnerabilityReport]{@link google.cloud.osconfig.v1alpha.VulnerabilityReport} 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 `listVulnerabilityReportsAsync()` + * 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. + */ + listVulnerabilityReportsStream( + request?: protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest, + 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['listVulnerabilityReports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVulnerabilityReports.createStream( + this.innerApiCalls.listVulnerabilityReports as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listVulnerabilityReports`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * + * Format: `projects/{project}/locations/{location}/instances/-` + * + * For `{project}`, either `project-number` or `project-id` can be provided. + * @param {number} request.pageSize + * The maximum number of results to return. + * @param {string} request.pageToken + * A pagination token returned from a previous call to + * `ListVulnerabilityReports` that indicates where this listing + * should continue from. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by a + * `vulnerabilityReport` API resource to be included in the response. + * @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 + * [VulnerabilityReport]{@link google.cloud.osconfig.v1alpha.VulnerabilityReport}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/os_config_zonal_service.list_vulnerability_reports.js + * region_tag:osconfig_v1alpha_generated_OsConfigZonalService_ListVulnerabilityReports_async + */ + listVulnerabilityReportsAsync( + request?: protos.google.cloud.osconfig.v1alpha.IListVulnerabilityReportsRequest, + 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['listVulnerabilityReports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVulnerabilityReports.asyncIterate( + this.innerApiCalls['listVulnerabilityReports'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instanceOSPoliciesCompliance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instanceOSPoliciesCompliancePath( + project: string, + location: string, + instance: string + ) { + return this.pathTemplates.instanceOSPoliciesCompliancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from InstanceOSPoliciesCompliance resource. + * + * @param {string} instanceOSPoliciesComplianceName + * A fully-qualified path representing InstanceOSPoliciesCompliance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceOSPoliciesComplianceName( + instanceOSPoliciesComplianceName: string + ) { + return this.pathTemplates.instanceOSPoliciesCompliancePathTemplate.match( + instanceOSPoliciesComplianceName + ).project; + } + + /** + * Parse the location from InstanceOSPoliciesCompliance resource. + * + * @param {string} instanceOSPoliciesComplianceName + * A fully-qualified path representing InstanceOSPoliciesCompliance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceOSPoliciesComplianceName( + instanceOSPoliciesComplianceName: string + ) { + return this.pathTemplates.instanceOSPoliciesCompliancePathTemplate.match( + instanceOSPoliciesComplianceName + ).location; + } + + /** + * Parse the instance from InstanceOSPoliciesCompliance resource. + * + * @param {string} instanceOSPoliciesComplianceName + * A fully-qualified path representing InstanceOSPoliciesCompliance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceOSPoliciesComplianceName( + instanceOSPoliciesComplianceName: string + ) { + return this.pathTemplates.instanceOSPoliciesCompliancePathTemplate.match( + instanceOSPoliciesComplianceName + ).instance; + } + + /** + * Return a fully-qualified inventory resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + inventoryPath(project: string, location: string, instance: string) { + return this.pathTemplates.inventoryPathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .project; + } + + /** + * Parse the location from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .location; + } + + /** + * Parse the instance from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .instance; + } + + /** + * Return a fully-qualified oSPolicyAssignment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} os_policy_assignment + * @returns {string} Resource name string. + */ + oSPolicyAssignmentPath( + project: string, + location: string, + osPolicyAssignment: string + ) { + return this.pathTemplates.oSPolicyAssignmentPathTemplate.render({ + project: project, + location: location, + os_policy_assignment: osPolicyAssignment, + }); + } + + /** + * Parse the project from OSPolicyAssignment resource. + * + * @param {string} oSPolicyAssignmentName + * A fully-qualified path representing OSPolicyAssignment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOSPolicyAssignmentName(oSPolicyAssignmentName: string) { + return this.pathTemplates.oSPolicyAssignmentPathTemplate.match( + oSPolicyAssignmentName + ).project; + } + + /** + * Parse the location from OSPolicyAssignment resource. + * + * @param {string} oSPolicyAssignmentName + * A fully-qualified path representing OSPolicyAssignment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOSPolicyAssignmentName(oSPolicyAssignmentName: string) { + return this.pathTemplates.oSPolicyAssignmentPathTemplate.match( + oSPolicyAssignmentName + ).location; + } + + /** + * Parse the os_policy_assignment from OSPolicyAssignment resource. + * + * @param {string} oSPolicyAssignmentName + * A fully-qualified path representing OSPolicyAssignment resource. + * @returns {string} A string representing the os_policy_assignment. + */ + matchOsPolicyAssignmentFromOSPolicyAssignmentName( + oSPolicyAssignmentName: string + ) { + return this.pathTemplates.oSPolicyAssignmentPathTemplate.match( + oSPolicyAssignmentName + ).os_policy_assignment; + } + + /** + * Return a fully-qualified oSPolicyAssignmentReport resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @param {string} assignment + * @returns {string} Resource name string. + */ + oSPolicyAssignmentReportPath( + project: string, + location: string, + instance: string, + assignment: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.render({ + project: project, + location: location, + instance: instance, + assignment: assignment, + }); + } + + /** + * Parse the project from OSPolicyAssignmentReport resource. + * + * @param {string} oSPolicyAssignmentReportName + * A fully-qualified path representing OSPolicyAssignmentReport resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOSPolicyAssignmentReportName( + oSPolicyAssignmentReportName: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.match( + oSPolicyAssignmentReportName + ).project; + } + + /** + * Parse the location from OSPolicyAssignmentReport resource. + * + * @param {string} oSPolicyAssignmentReportName + * A fully-qualified path representing OSPolicyAssignmentReport resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOSPolicyAssignmentReportName( + oSPolicyAssignmentReportName: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.match( + oSPolicyAssignmentReportName + ).location; + } + + /** + * Parse the instance from OSPolicyAssignmentReport resource. + * + * @param {string} oSPolicyAssignmentReportName + * A fully-qualified path representing OSPolicyAssignmentReport resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromOSPolicyAssignmentReportName( + oSPolicyAssignmentReportName: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.match( + oSPolicyAssignmentReportName + ).instance; + } + + /** + * Parse the assignment from OSPolicyAssignmentReport resource. + * + * @param {string} oSPolicyAssignmentReportName + * A fully-qualified path representing OSPolicyAssignmentReport resource. + * @returns {string} A string representing the assignment. + */ + matchAssignmentFromOSPolicyAssignmentReportName( + oSPolicyAssignmentReportName: string + ) { + return this.pathTemplates.oSPolicyAssignmentReportPathTemplate.match( + oSPolicyAssignmentReportName + ).assignment; + } + + /** + * Return a fully-qualified vulnerabilityReport resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + vulnerabilityReportPath(project: string, location: string, instance: string) { + return this.pathTemplates.vulnerabilityReportPathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from VulnerabilityReport resource. + * + * @param {string} vulnerabilityReportName + * A fully-qualified path representing VulnerabilityReport resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVulnerabilityReportName(vulnerabilityReportName: string) { + return this.pathTemplates.vulnerabilityReportPathTemplate.match( + vulnerabilityReportName + ).project; + } + + /** + * Parse the location from VulnerabilityReport resource. + * + * @param {string} vulnerabilityReportName + * A fully-qualified path representing VulnerabilityReport resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVulnerabilityReportName(vulnerabilityReportName: string) { + return this.pathTemplates.vulnerabilityReportPathTemplate.match( + vulnerabilityReportName + ).location; + } + + /** + * Parse the instance from VulnerabilityReport resource. + * + * @param {string} vulnerabilityReportName + * A fully-qualified path representing VulnerabilityReport resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromVulnerabilityReportName(vulnerabilityReportName: string) { + return this.pathTemplates.vulnerabilityReportPathTemplate.match( + vulnerabilityReportName + ).instance; + } + + /** + * 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.osConfigZonalServiceStub && !this._terminated) { + return this.osConfigZonalServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-osconfig/src/v1alpha/os_config_zonal_service_client_config.json b/packages/google-cloud-osconfig/src/v1alpha/os_config_zonal_service_client_config.json new file mode 100644 index 00000000000..130d4b4af17 --- /dev/null +++ b/packages/google-cloud-osconfig/src/v1alpha/os_config_zonal_service_client_config.json @@ -0,0 +1,108 @@ +{ + "interfaces": { + "google.cloud.osconfig.v1alpha.OsConfigZonalService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { + "initial_retry_delay_millis": 1000, + "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": { + "CreateOSPolicyAssignment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateOSPolicyAssignment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetOSPolicyAssignment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListOSPolicyAssignments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListOSPolicyAssignmentRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteOSPolicyAssignment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetInstanceOSPoliciesCompliance": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListInstanceOSPoliciesCompliances": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetOSPolicyAssignmentReport": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListOSPolicyAssignmentReports": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetInventory": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListInventories": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetVulnerabilityReport": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListVulnerabilityReports": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + } + } + } + } +} diff --git a/packages/google-cloud-osconfig/src/v1alpha/os_config_zonal_service_proto_list.json b/packages/google-cloud-osconfig/src/v1alpha/os_config_zonal_service_proto_list.json new file mode 100644 index 00000000000..8cf88654436 --- /dev/null +++ b/packages/google-cloud-osconfig/src/v1alpha/os_config_zonal_service_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/cloud/osconfig/v1alpha/config_common.proto", + "../../protos/google/cloud/osconfig/v1alpha/instance_os_policies_compliance.proto", + "../../protos/google/cloud/osconfig/v1alpha/inventory.proto", + "../../protos/google/cloud/osconfig/v1alpha/os_policy.proto", + "../../protos/google/cloud/osconfig/v1alpha/os_policy_assignment_reports.proto", + "../../protos/google/cloud/osconfig/v1alpha/os_policy_assignments.proto", + "../../protos/google/cloud/osconfig/v1alpha/osconfig_common.proto", + "../../protos/google/cloud/osconfig/v1alpha/osconfig_zonal_service.proto", + "../../protos/google/cloud/osconfig/v1alpha/vulnerability.proto" +] diff --git a/packages/google-cloud-osconfig/system-test/fixtures/sample/src/index.js b/packages/google-cloud-osconfig/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..00bc3ccd4d0 --- /dev/null +++ b/packages/google-cloud-osconfig/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const osconfig = require('@google-cloud/os-config'); + +function main() { + const osConfigServiceClient = new osconfig.OsConfigServiceClient(); + const osConfigZonalServiceClient = new osconfig.OsConfigZonalServiceClient(); +} + +main(); diff --git a/packages/google-cloud-osconfig/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-osconfig/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..3d08a8e01f4 --- /dev/null +++ b/packages/google-cloud-osconfig/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,43 @@ +// 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 { + OsConfigServiceClient, + OsConfigZonalServiceClient, +} from '@google-cloud/os-config'; + +// check that the client class type name can be used +function doStuffWithOsConfigServiceClient(client: OsConfigServiceClient) { + client.close(); +} +function doStuffWithOsConfigZonalServiceClient( + client: OsConfigZonalServiceClient +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const osConfigServiceClient = new OsConfigServiceClient(); + doStuffWithOsConfigServiceClient(osConfigServiceClient); + // check that the client instance can be created + const osConfigZonalServiceClient = new OsConfigZonalServiceClient(); + doStuffWithOsConfigZonalServiceClient(osConfigZonalServiceClient); +} + +main(); diff --git a/packages/google-cloud-osconfig/system-test/install.ts b/packages/google-cloud-osconfig/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-osconfig/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-osconfig/test/gapic_os_config_service_v1.ts b/packages/google-cloud-osconfig/test/gapic_os_config_service_v1.ts new file mode 100644 index 00000000000..0c0ee2cfe1b --- /dev/null +++ b/packages/google-cloud-osconfig/test/gapic_os_config_service_v1.ts @@ -0,0 +1,2838 @@ +// 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 osconfigserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.OsConfigServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + osconfigserviceModule.v1.OsConfigServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + osconfigserviceModule.v1.OsConfigServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = osconfigserviceModule.v1.OsConfigServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.osConfigServiceStub, undefined); + await client.initialize(); + assert(client.osConfigServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.osConfigServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.osConfigServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + 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 osconfigserviceModule.v1.OsConfigServiceClient({ + 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('executePatchJob', () => { + it('invokes executePatchJob without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ExecutePatchJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ExecutePatchJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJob() + ); + client.innerApiCalls.executePatchJob = stubSimpleCall(expectedResponse); + const [response] = await client.executePatchJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.executePatchJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executePatchJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executePatchJob without error using callback', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ExecutePatchJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ExecutePatchJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJob() + ); + client.innerApiCalls.executePatchJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.executePatchJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IPatchJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.executePatchJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executePatchJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executePatchJob with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ExecutePatchJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ExecutePatchJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.executePatchJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.executePatchJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.executePatchJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executePatchJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executePatchJob with closed client', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ExecutePatchJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ExecutePatchJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.executePatchJob(request), expectedError); + }); + }); + + describe('getPatchJob', () => { + it('invokes getPatchJob without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetPatchJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetPatchJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJob() + ); + client.innerApiCalls.getPatchJob = stubSimpleCall(expectedResponse); + const [response] = await client.getPatchJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPatchJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPatchJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPatchJob without error using callback', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetPatchJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetPatchJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJob() + ); + client.innerApiCalls.getPatchJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPatchJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IPatchJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPatchJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPatchJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPatchJob with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetPatchJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetPatchJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPatchJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getPatchJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPatchJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPatchJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPatchJob with closed client', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetPatchJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetPatchJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPatchJob(request), expectedError); + }); + }); + + describe('cancelPatchJob', () => { + it('invokes cancelPatchJob without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.CancelPatchJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.CancelPatchJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJob() + ); + client.innerApiCalls.cancelPatchJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelPatchJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelPatchJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelPatchJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelPatchJob without error using callback', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.CancelPatchJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.CancelPatchJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJob() + ); + client.innerApiCalls.cancelPatchJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelPatchJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IPatchJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelPatchJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelPatchJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelPatchJob with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.CancelPatchJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.CancelPatchJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelPatchJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.cancelPatchJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelPatchJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelPatchJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelPatchJob with closed client', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.CancelPatchJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.CancelPatchJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelPatchJob(request), expectedError); + }); + }); + + describe('createPatchDeployment', () => { + it('invokes createPatchDeployment without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.CreatePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.CreatePatchDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ); + client.innerApiCalls.createPatchDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.createPatchDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPatchDeployment without error using callback', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.CreatePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.CreatePatchDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ); + client.innerApiCalls.createPatchDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPatchDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IPatchDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPatchDeployment with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.CreatePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.CreatePatchDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPatchDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createPatchDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createPatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPatchDeployment with closed client', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.CreatePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.CreatePatchDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createPatchDeployment(request), + expectedError + ); + }); + }); + + describe('getPatchDeployment', () => { + it('invokes getPatchDeployment without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetPatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetPatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ); + client.innerApiCalls.getPatchDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.getPatchDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPatchDeployment without error using callback', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetPatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetPatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ); + client.innerApiCalls.getPatchDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPatchDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IPatchDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPatchDeployment with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetPatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetPatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPatchDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getPatchDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPatchDeployment with closed client', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetPatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetPatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPatchDeployment(request), expectedError); + }); + }); + + describe('deletePatchDeployment', () => { + it('invokes deletePatchDeployment without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.DeletePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.DeletePatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePatchDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.deletePatchDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePatchDeployment without error using callback', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.DeletePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.DeletePatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePatchDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePatchDeployment( + 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.deletePatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePatchDeployment with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.DeletePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.DeletePatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePatchDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deletePatchDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deletePatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePatchDeployment with closed client', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.DeletePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.DeletePatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deletePatchDeployment(request), + expectedError + ); + }); + }); + + describe('updatePatchDeployment', () => { + it('invokes updatePatchDeployment without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.UpdatePatchDeploymentRequest() + ); + request.patchDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.UpdatePatchDeploymentRequest', + ['patchDeployment', 'name'] + ); + request.patchDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `patch_deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ); + client.innerApiCalls.updatePatchDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.updatePatchDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePatchDeployment without error using callback', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.UpdatePatchDeploymentRequest() + ); + request.patchDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.UpdatePatchDeploymentRequest', + ['patchDeployment', 'name'] + ); + request.patchDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `patch_deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ); + client.innerApiCalls.updatePatchDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePatchDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IPatchDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePatchDeployment with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.UpdatePatchDeploymentRequest() + ); + request.patchDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.UpdatePatchDeploymentRequest', + ['patchDeployment', 'name'] + ); + request.patchDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `patch_deployment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePatchDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updatePatchDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updatePatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePatchDeployment with closed client', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.UpdatePatchDeploymentRequest() + ); + request.patchDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.UpdatePatchDeploymentRequest', + ['patchDeployment', 'name'] + ); + request.patchDeployment.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updatePatchDeployment(request), + expectedError + ); + }); + }); + + describe('pausePatchDeployment', () => { + it('invokes pausePatchDeployment without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PausePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.PausePatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ); + client.innerApiCalls.pausePatchDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.pausePatchDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pausePatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pausePatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pausePatchDeployment without error using callback', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PausePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.PausePatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ); + client.innerApiCalls.pausePatchDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pausePatchDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IPatchDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pausePatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pausePatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pausePatchDeployment with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PausePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.PausePatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pausePatchDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.pausePatchDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.pausePatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pausePatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pausePatchDeployment with closed client', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PausePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.PausePatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.pausePatchDeployment(request), expectedError); + }); + }); + + describe('resumePatchDeployment', () => { + it('invokes resumePatchDeployment without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ResumePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ResumePatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ); + client.innerApiCalls.resumePatchDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.resumePatchDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resumePatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumePatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumePatchDeployment without error using callback', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ResumePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ResumePatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ); + client.innerApiCalls.resumePatchDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resumePatchDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IPatchDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resumePatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumePatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumePatchDeployment with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ResumePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ResumePatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumePatchDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.resumePatchDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.resumePatchDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumePatchDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumePatchDeployment with closed client', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ResumePatchDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ResumePatchDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.resumePatchDeployment(request), + expectedError + ); + }); + }); + + describe('listPatchJobs', () => { + it('invokes listPatchJobs without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.osconfig.v1.PatchJob()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.PatchJob()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.PatchJob()), + ]; + client.innerApiCalls.listPatchJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listPatchJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPatchJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPatchJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPatchJobs without error using callback', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.osconfig.v1.PatchJob()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.PatchJob()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.PatchJob()), + ]; + client.innerApiCalls.listPatchJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPatchJobs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IPatchJob[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPatchJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPatchJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPatchJobs with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPatchJobs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listPatchJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPatchJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPatchJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPatchJobsStream without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.osconfig.v1.PatchJob()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.PatchJob()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.PatchJob()), + ]; + client.descriptors.page.listPatchJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPatchJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.PatchJob[] = []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1.PatchJob) => { + 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.listPatchJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPatchJobs, request) + ); + assert( + (client.descriptors.page.listPatchJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPatchJobsStream with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPatchJobs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPatchJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.PatchJob[] = []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1.PatchJob) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPatchJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPatchJobs, request) + ); + assert( + (client.descriptors.page.listPatchJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPatchJobs without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.osconfig.v1.PatchJob()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.PatchJob()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.PatchJob()), + ]; + client.descriptors.page.listPatchJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1.IPatchJob[] = []; + const iterable = client.listPatchJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPatchJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPatchJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPatchJobs with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPatchJobs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPatchJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1.IPatchJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPatchJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPatchJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listPatchJobInstanceDetails', () => { + it('invokes listPatchJobInstanceDetails without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJobInstanceDetails() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJobInstanceDetails() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJobInstanceDetails() + ), + ]; + client.innerApiCalls.listPatchJobInstanceDetails = + stubSimpleCall(expectedResponse); + const [response] = await client.listPatchJobInstanceDetails(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPatchJobInstanceDetails as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPatchJobInstanceDetails as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPatchJobInstanceDetails without error using callback', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJobInstanceDetails() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJobInstanceDetails() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJobInstanceDetails() + ), + ]; + client.innerApiCalls.listPatchJobInstanceDetails = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPatchJobInstanceDetails( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPatchJobInstanceDetails as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPatchJobInstanceDetails as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPatchJobInstanceDetails with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPatchJobInstanceDetails = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listPatchJobInstanceDetails(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listPatchJobInstanceDetails as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPatchJobInstanceDetails as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPatchJobInstanceDetailsStream without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJobInstanceDetails() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJobInstanceDetails() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJobInstanceDetails() + ), + ]; + client.descriptors.page.listPatchJobInstanceDetails.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPatchJobInstanceDetailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.PatchJobInstanceDetails[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1.PatchJobInstanceDetails + ) => { + 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.listPatchJobInstanceDetails + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listPatchJobInstanceDetails, request) + ); + assert( + ( + client.descriptors.page.listPatchJobInstanceDetails + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPatchJobInstanceDetailsStream with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPatchJobInstanceDetails.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPatchJobInstanceDetailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.PatchJobInstanceDetails[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1.PatchJobInstanceDetails + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listPatchJobInstanceDetails + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listPatchJobInstanceDetails, request) + ); + assert( + ( + client.descriptors.page.listPatchJobInstanceDetails + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPatchJobInstanceDetails without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJobInstanceDetails() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJobInstanceDetails() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchJobInstanceDetails() + ), + ]; + client.descriptors.page.listPatchJobInstanceDetails.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails[] = + []; + const iterable = client.listPatchJobInstanceDetailsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPatchJobInstanceDetails + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listPatchJobInstanceDetails + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPatchJobInstanceDetails with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchJobInstanceDetailsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPatchJobInstanceDetails.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPatchJobInstanceDetailsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPatchJobInstanceDetails + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listPatchJobInstanceDetails + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listPatchDeployments', () => { + it('invokes listPatchDeployments without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ), + ]; + client.innerApiCalls.listPatchDeployments = + stubSimpleCall(expectedResponse); + const [response] = await client.listPatchDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPatchDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPatchDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPatchDeployments without error using callback', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ), + ]; + client.innerApiCalls.listPatchDeployments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPatchDeployments( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IPatchDeployment[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPatchDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPatchDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPatchDeployments with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPatchDeployments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listPatchDeployments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPatchDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPatchDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPatchDeploymentsStream without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ), + ]; + client.descriptors.page.listPatchDeployments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPatchDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.PatchDeployment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1.PatchDeployment) => { + 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.listPatchDeployments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPatchDeployments, request) + ); + assert( + (client.descriptors.page.listPatchDeployments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPatchDeploymentsStream with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPatchDeployments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPatchDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.PatchDeployment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1.PatchDeployment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPatchDeployments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPatchDeployments, request) + ); + assert( + (client.descriptors.page.listPatchDeployments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPatchDeployments without error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.PatchDeployment() + ), + ]; + client.descriptors.page.listPatchDeployments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1.IPatchDeployment[] = []; + const iterable = client.listPatchDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPatchDeployments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPatchDeployments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPatchDeployments with error', async () => { + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListPatchDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListPatchDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPatchDeployments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPatchDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1.IPatchDeployment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPatchDeployments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPatchDeployments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('inventory', () => { + const fakePath = '/rendered/path/inventory'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.inventoryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.inventoryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('inventoryPath', () => { + const result = client.inventoryPath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.inventoryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInventoryName', () => { + const result = client.matchProjectFromInventoryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInventoryName', () => { + const result = client.matchLocationFromInventoryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInventoryName', () => { + const result = client.matchInstanceFromInventoryName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('oSPolicyAssignment', () => { + const fakePath = '/rendered/path/oSPolicyAssignment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + os_policy_assignment: 'osPolicyAssignmentValue', + }; + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.oSPolicyAssignmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.oSPolicyAssignmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('oSPolicyAssignmentPath', () => { + const result = client.oSPolicyAssignmentPath( + 'projectValue', + 'locationValue', + 'osPolicyAssignmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.oSPolicyAssignmentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromOSPolicyAssignmentName', () => { + const result = client.matchProjectFromOSPolicyAssignmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOSPolicyAssignmentName', () => { + const result = client.matchLocationFromOSPolicyAssignmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchOsPolicyAssignmentFromOSPolicyAssignmentName', () => { + const result = + client.matchOsPolicyAssignmentFromOSPolicyAssignmentName(fakePath); + assert.strictEqual(result, 'osPolicyAssignmentValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('oSPolicyAssignmentReport', () => { + const fakePath = '/rendered/path/oSPolicyAssignmentReport'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + assignment: 'assignmentValue', + }; + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.oSPolicyAssignmentReportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.oSPolicyAssignmentReportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('oSPolicyAssignmentReportPath', () => { + const result = client.oSPolicyAssignmentReportPath( + 'projectValue', + 'locationValue', + 'instanceValue', + 'assignmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromOSPolicyAssignmentReportName', () => { + const result = + client.matchProjectFromOSPolicyAssignmentReportName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOSPolicyAssignmentReportName', () => { + const result = + client.matchLocationFromOSPolicyAssignmentReportName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromOSPolicyAssignmentReportName', () => { + const result = + client.matchInstanceFromOSPolicyAssignmentReportName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssignmentFromOSPolicyAssignmentReportName', () => { + const result = + client.matchAssignmentFromOSPolicyAssignmentReportName(fakePath); + assert.strictEqual(result, 'assignmentValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('patchDeployment', () => { + const fakePath = '/rendered/path/patchDeployment'; + const expectedParameters = { + project: 'projectValue', + patch_deployment: 'patchDeploymentValue', + }; + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.patchDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.patchDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('patchDeploymentPath', () => { + const result = client.patchDeploymentPath( + 'projectValue', + 'patchDeploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.patchDeploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPatchDeploymentName', () => { + const result = client.matchProjectFromPatchDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.patchDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPatchDeploymentFromPatchDeploymentName', () => { + const result = + client.matchPatchDeploymentFromPatchDeploymentName(fakePath); + assert.strictEqual(result, 'patchDeploymentValue'); + assert( + (client.pathTemplates.patchDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('patchJob', () => { + const fakePath = '/rendered/path/patchJob'; + const expectedParameters = { + project: 'projectValue', + patch_job: 'patchJobValue', + }; + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.patchJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.patchJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('patchJobPath', () => { + const result = client.patchJobPath('projectValue', 'patchJobValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.patchJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPatchJobName', () => { + const result = client.matchProjectFromPatchJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.patchJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPatchJobFromPatchJobName', () => { + const result = client.matchPatchJobFromPatchJobName(fakePath); + assert.strictEqual(result, 'patchJobValue'); + assert( + (client.pathTemplates.patchJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('vulnerabilityReport', () => { + const fakePath = '/rendered/path/vulnerabilityReport'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new osconfigserviceModule.v1.OsConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.vulnerabilityReportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.vulnerabilityReportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('vulnerabilityReportPath', () => { + const result = client.vulnerabilityReportPath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.vulnerabilityReportPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVulnerabilityReportName', () => { + const result = client.matchProjectFromVulnerabilityReportName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.vulnerabilityReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVulnerabilityReportName', () => { + const result = + client.matchLocationFromVulnerabilityReportName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.vulnerabilityReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromVulnerabilityReportName', () => { + const result = + client.matchInstanceFromVulnerabilityReportName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + ( + client.pathTemplates.vulnerabilityReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-osconfig/test/gapic_os_config_zonal_service_v1.ts b/packages/google-cloud-osconfig/test/gapic_os_config_zonal_service_v1.ts new file mode 100644 index 00000000000..0471e7989fb --- /dev/null +++ b/packages/google-cloud-osconfig/test/gapic_os_config_zonal_service_v1.ts @@ -0,0 +1,3638 @@ +// 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 osconfigzonalserviceModule 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.OsConfigZonalServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + osconfigzonalserviceModule.v1.OsConfigZonalServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + osconfigzonalserviceModule.v1.OsConfigZonalServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + osconfigzonalserviceModule.v1.OsConfigZonalServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.osConfigZonalServiceStub, undefined); + await client.initialize(); + assert(client.osConfigZonalServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.osConfigZonalServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.osConfigZonalServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + 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 osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + 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('getOSPolicyAssignment', () => { + it('invokes getOSPolicyAssignment without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ); + client.innerApiCalls.getOsPolicyAssignment = + stubSimpleCall(expectedResponse); + const [response] = await client.getOSPolicyAssignment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOSPolicyAssignment without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ); + client.innerApiCalls.getOsPolicyAssignment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOSPolicyAssignment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IOSPolicyAssignment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOSPolicyAssignment with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOsPolicyAssignment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getOSPolicyAssignment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOSPolicyAssignment with closed client', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getOSPolicyAssignment(request), + expectedError + ); + }); + }); + + describe('getOSPolicyAssignmentReport', () => { + it('invokes getOSPolicyAssignmentReport without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ); + client.innerApiCalls.getOsPolicyAssignmentReport = + stubSimpleCall(expectedResponse); + const [response] = await client.getOSPolicyAssignmentReport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOsPolicyAssignmentReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOsPolicyAssignmentReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOSPolicyAssignmentReport without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ); + client.innerApiCalls.getOsPolicyAssignmentReport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOSPolicyAssignmentReport( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOsPolicyAssignmentReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOsPolicyAssignmentReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOSPolicyAssignmentReport with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOsPolicyAssignmentReport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getOSPolicyAssignmentReport(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getOsPolicyAssignmentReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOsPolicyAssignmentReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOSPolicyAssignmentReport with closed client', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getOSPolicyAssignmentReport(request), + expectedError + ); + }); + }); + + describe('getInventory', () => { + it('invokes getInventory without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetInventoryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetInventoryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.Inventory() + ); + client.innerApiCalls.getInventory = stubSimpleCall(expectedResponse); + const [response] = await client.getInventory(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInventory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInventory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInventory without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetInventoryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetInventoryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.Inventory() + ); + client.innerApiCalls.getInventory = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInventory( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IInventory | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInventory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInventory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInventory with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetInventoryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetInventoryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInventory = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getInventory(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getInventory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInventory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInventory with closed client', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetInventoryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetInventoryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInventory(request), expectedError); + }); + }); + + describe('getVulnerabilityReport', () => { + it('invokes getVulnerabilityReport without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetVulnerabilityReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetVulnerabilityReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ); + client.innerApiCalls.getVulnerabilityReport = + stubSimpleCall(expectedResponse); + const [response] = await client.getVulnerabilityReport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVulnerabilityReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVulnerabilityReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVulnerabilityReport without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetVulnerabilityReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetVulnerabilityReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ); + client.innerApiCalls.getVulnerabilityReport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getVulnerabilityReport( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IVulnerabilityReport | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVulnerabilityReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVulnerabilityReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVulnerabilityReport with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetVulnerabilityReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetVulnerabilityReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getVulnerabilityReport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getVulnerabilityReport(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getVulnerabilityReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVulnerabilityReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVulnerabilityReport with closed client', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.GetVulnerabilityReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.GetVulnerabilityReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getVulnerabilityReport(request), + expectedError + ); + }); + }); + + describe('createOSPolicyAssignment', () => { + it('invokes createOSPolicyAssignment without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createOsPolicyAssignment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createOSPolicyAssignment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createOSPolicyAssignment without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createOsPolicyAssignment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createOSPolicyAssignment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createOSPolicyAssignment with call error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createOsPolicyAssignment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createOSPolicyAssignment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createOSPolicyAssignment with LRO error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createOsPolicyAssignment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createOSPolicyAssignment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateOSPolicyAssignmentProgress without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + 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.checkCreateOSPolicyAssignmentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateOSPolicyAssignmentProgress with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + 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.checkCreateOSPolicyAssignmentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateOSPolicyAssignment', () => { + it('invokes updateOSPolicyAssignment without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest() + ); + request.osPolicyAssignment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest', + ['osPolicyAssignment', 'name'] + ); + request.osPolicyAssignment.name = defaultValue1; + const expectedHeaderRequestParams = `os_policy_assignment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateOsPolicyAssignment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateOSPolicyAssignment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOSPolicyAssignment without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest() + ); + request.osPolicyAssignment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest', + ['osPolicyAssignment', 'name'] + ); + request.osPolicyAssignment.name = defaultValue1; + const expectedHeaderRequestParams = `os_policy_assignment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateOsPolicyAssignment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateOSPolicyAssignment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.osconfig.v1.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOSPolicyAssignment with call error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest() + ); + request.osPolicyAssignment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest', + ['osPolicyAssignment', 'name'] + ); + request.osPolicyAssignment.name = defaultValue1; + const expectedHeaderRequestParams = `os_policy_assignment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOsPolicyAssignment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateOSPolicyAssignment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOSPolicyAssignment with LRO error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest() + ); + request.osPolicyAssignment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest', + ['osPolicyAssignment', 'name'] + ); + request.osPolicyAssignment.name = defaultValue1; + const expectedHeaderRequestParams = `os_policy_assignment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOsPolicyAssignment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateOSPolicyAssignment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateOSPolicyAssignmentProgress without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + 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.checkUpdateOSPolicyAssignmentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateOSPolicyAssignmentProgress with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + 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.checkUpdateOSPolicyAssignmentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteOSPolicyAssignment', () => { + it('invokes deleteOSPolicyAssignment without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteOsPolicyAssignment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteOSPolicyAssignment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteOSPolicyAssignment without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteOsPolicyAssignment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteOSPolicyAssignment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1.IOSPolicyAssignmentOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteOSPolicyAssignment with call error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteOsPolicyAssignment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteOSPolicyAssignment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteOSPolicyAssignment with LRO error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteOsPolicyAssignment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteOSPolicyAssignment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteOSPolicyAssignmentProgress without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + 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.checkDeleteOSPolicyAssignmentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteOSPolicyAssignmentProgress with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + 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.checkDeleteOSPolicyAssignmentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listOSPolicyAssignments', () => { + it('invokes listOSPolicyAssignments without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + ]; + client.innerApiCalls.listOsPolicyAssignments = + stubSimpleCall(expectedResponse); + const [response] = await client.listOSPolicyAssignments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignments without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + ]; + client.innerApiCalls.listOsPolicyAssignments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOSPolicyAssignments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.osconfig.v1.IOSPolicyAssignment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignments with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOsPolicyAssignments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listOSPolicyAssignments(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentsStream without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + ]; + client.descriptors.page.listOSPolicyAssignments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listOSPolicyAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.OSPolicyAssignment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1.OSPolicyAssignment) => { + 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.listOSPolicyAssignments + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listOsPolicyAssignments, request) + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignments + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listOSPolicyAssignmentsStream with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOSPolicyAssignments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listOSPolicyAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.OSPolicyAssignment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1.OSPolicyAssignment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listOSPolicyAssignments + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listOsPolicyAssignments, request) + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignments + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOSPolicyAssignments without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + ]; + client.descriptors.page.listOSPolicyAssignments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1.IOSPolicyAssignment[] = + []; + const iterable = client.listOSPolicyAssignmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listOSPolicyAssignments + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignments + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOSPolicyAssignments with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOSPolicyAssignments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listOSPolicyAssignmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1.IOSPolicyAssignment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listOSPolicyAssignments + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignments + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listOSPolicyAssignmentRevisions', () => { + it('invokes listOSPolicyAssignmentRevisions without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + ]; + client.innerApiCalls.listOsPolicyAssignmentRevisions = + stubSimpleCall(expectedResponse); + const [response] = await client.listOSPolicyAssignmentRevisions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignmentRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignmentRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentRevisions without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + ]; + client.innerApiCalls.listOsPolicyAssignmentRevisions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOSPolicyAssignmentRevisions( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.osconfig.v1.IOSPolicyAssignment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignmentRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignmentRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentRevisions with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOsPolicyAssignmentRevisions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listOSPolicyAssignmentRevisions(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignmentRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignmentRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentRevisionsStream without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + ]; + client.descriptors.page.listOSPolicyAssignmentRevisions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listOSPolicyAssignmentRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.OSPolicyAssignment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1.OSPolicyAssignment) => { + 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.listOSPolicyAssignmentRevisions + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listOsPolicyAssignmentRevisions, + request + ) + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listOSPolicyAssignmentRevisionsStream with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOSPolicyAssignmentRevisions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listOSPolicyAssignmentRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.OSPolicyAssignment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1.OSPolicyAssignment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listOsPolicyAssignmentRevisions, + request + ) + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOSPolicyAssignmentRevisions without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignment() + ), + ]; + client.descriptors.page.listOSPolicyAssignmentRevisions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1.IOSPolicyAssignment[] = + []; + const iterable = client.listOSPolicyAssignmentRevisionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOSPolicyAssignmentRevisions with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOSPolicyAssignmentRevisions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listOSPolicyAssignmentRevisionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1.IOSPolicyAssignment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listOSPolicyAssignmentReports', () => { + it('invokes listOSPolicyAssignmentReports without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ), + ]; + client.innerApiCalls.listOsPolicyAssignmentReports = + stubSimpleCall(expectedResponse); + const [response] = await client.listOSPolicyAssignmentReports(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignmentReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignmentReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentReports without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ), + ]; + client.innerApiCalls.listOsPolicyAssignmentReports = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOSPolicyAssignmentReports( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignmentReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignmentReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentReports with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOsPolicyAssignmentReports = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listOSPolicyAssignmentReports(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignmentReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignmentReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentReportsStream without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ), + ]; + client.descriptors.page.listOSPolicyAssignmentReports.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listOSPolicyAssignmentReportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport + ) => { + 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.listOSPolicyAssignmentReports + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listOsPolicyAssignmentReports, + request + ) + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listOSPolicyAssignmentReportsStream with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOSPolicyAssignmentReports.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listOSPolicyAssignmentReportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listOsPolicyAssignmentReports, + request + ) + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOSPolicyAssignmentReports without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.OSPolicyAssignmentReport() + ), + ]; + client.descriptors.page.listOSPolicyAssignmentReports.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport[] = + []; + const iterable = client.listOSPolicyAssignmentReportsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOSPolicyAssignmentReports with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOSPolicyAssignmentReports.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listOSPolicyAssignmentReportsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1.IOSPolicyAssignmentReport[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInventories', () => { + it('invokes listInventories without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.osconfig.v1.Inventory()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.Inventory()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.Inventory()), + ]; + client.innerApiCalls.listInventories = stubSimpleCall(expectedResponse); + const [response] = await client.listInventories(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInventories as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInventories as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInventories without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.osconfig.v1.Inventory()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.Inventory()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.Inventory()), + ]; + client.innerApiCalls.listInventories = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInventories( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1.IInventory[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInventories as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInventories as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInventories with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInventories = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listInventories(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listInventories as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInventories as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInventoriesStream without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.osconfig.v1.Inventory()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.Inventory()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.Inventory()), + ]; + client.descriptors.page.listInventories.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInventoriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.Inventory[] = []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1.Inventory) => { + 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.listInventories.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInventories, request) + ); + assert( + (client.descriptors.page.listInventories.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInventoriesStream with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInventories.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInventoriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.Inventory[] = []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1.Inventory) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listInventories.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInventories, request) + ); + assert( + (client.descriptors.page.listInventories.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInventories without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.osconfig.v1.Inventory()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.Inventory()), + generateSampleMessage(new protos.google.cloud.osconfig.v1.Inventory()), + ]; + client.descriptors.page.listInventories.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1.IInventory[] = []; + const iterable = client.listInventoriesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listInventories.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInventories.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInventories with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInventories.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInventoriesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1.IInventory[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listInventories.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInventories.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listVulnerabilityReports', () => { + it('invokes listVulnerabilityReports without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ), + ]; + client.innerApiCalls.listVulnerabilityReports = + stubSimpleCall(expectedResponse); + const [response] = await client.listVulnerabilityReports(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVulnerabilityReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVulnerabilityReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVulnerabilityReports without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ), + ]; + client.innerApiCalls.listVulnerabilityReports = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVulnerabilityReports( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.osconfig.v1.IVulnerabilityReport[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVulnerabilityReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVulnerabilityReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVulnerabilityReports with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listVulnerabilityReports = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listVulnerabilityReports(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listVulnerabilityReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVulnerabilityReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVulnerabilityReportsStream without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ), + ]; + client.descriptors.page.listVulnerabilityReports.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listVulnerabilityReportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.VulnerabilityReport[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1.VulnerabilityReport) => { + 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.listVulnerabilityReports + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listVulnerabilityReports, request) + ); + assert( + ( + client.descriptors.page.listVulnerabilityReports + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listVulnerabilityReportsStream with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVulnerabilityReports.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listVulnerabilityReportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1.VulnerabilityReport[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1.VulnerabilityReport) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listVulnerabilityReports + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listVulnerabilityReports, request) + ); + assert( + ( + client.descriptors.page.listVulnerabilityReports + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVulnerabilityReports without error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1.VulnerabilityReport() + ), + ]; + client.descriptors.page.listVulnerabilityReports.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1.IVulnerabilityReport[] = + []; + const iterable = client.listVulnerabilityReportsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listVulnerabilityReports + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listVulnerabilityReports + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVulnerabilityReports with error', async () => { + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVulnerabilityReports.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVulnerabilityReportsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1.IVulnerabilityReport[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listVulnerabilityReports + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listVulnerabilityReports + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('inventory', () => { + const fakePath = '/rendered/path/inventory'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.inventoryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.inventoryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('inventoryPath', () => { + const result = client.inventoryPath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.inventoryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInventoryName', () => { + const result = client.matchProjectFromInventoryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInventoryName', () => { + const result = client.matchLocationFromInventoryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInventoryName', () => { + const result = client.matchInstanceFromInventoryName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('oSPolicyAssignment', () => { + const fakePath = '/rendered/path/oSPolicyAssignment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + os_policy_assignment: 'osPolicyAssignmentValue', + }; + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.oSPolicyAssignmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.oSPolicyAssignmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('oSPolicyAssignmentPath', () => { + const result = client.oSPolicyAssignmentPath( + 'projectValue', + 'locationValue', + 'osPolicyAssignmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.oSPolicyAssignmentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromOSPolicyAssignmentName', () => { + const result = client.matchProjectFromOSPolicyAssignmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOSPolicyAssignmentName', () => { + const result = client.matchLocationFromOSPolicyAssignmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchOsPolicyAssignmentFromOSPolicyAssignmentName', () => { + const result = + client.matchOsPolicyAssignmentFromOSPolicyAssignmentName(fakePath); + assert.strictEqual(result, 'osPolicyAssignmentValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('oSPolicyAssignmentReport', () => { + const fakePath = '/rendered/path/oSPolicyAssignmentReport'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + assignment: 'assignmentValue', + }; + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.oSPolicyAssignmentReportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.oSPolicyAssignmentReportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('oSPolicyAssignmentReportPath', () => { + const result = client.oSPolicyAssignmentReportPath( + 'projectValue', + 'locationValue', + 'instanceValue', + 'assignmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromOSPolicyAssignmentReportName', () => { + const result = + client.matchProjectFromOSPolicyAssignmentReportName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOSPolicyAssignmentReportName', () => { + const result = + client.matchLocationFromOSPolicyAssignmentReportName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromOSPolicyAssignmentReportName', () => { + const result = + client.matchInstanceFromOSPolicyAssignmentReportName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssignmentFromOSPolicyAssignmentReportName', () => { + const result = + client.matchAssignmentFromOSPolicyAssignmentReportName(fakePath); + assert.strictEqual(result, 'assignmentValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('patchDeployment', () => { + const fakePath = '/rendered/path/patchDeployment'; + const expectedParameters = { + project: 'projectValue', + patch_deployment: 'patchDeploymentValue', + }; + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.patchDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.patchDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('patchDeploymentPath', () => { + const result = client.patchDeploymentPath( + 'projectValue', + 'patchDeploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.patchDeploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPatchDeploymentName', () => { + const result = client.matchProjectFromPatchDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.patchDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPatchDeploymentFromPatchDeploymentName', () => { + const result = + client.matchPatchDeploymentFromPatchDeploymentName(fakePath); + assert.strictEqual(result, 'patchDeploymentValue'); + assert( + (client.pathTemplates.patchDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('patchJob', () => { + const fakePath = '/rendered/path/patchJob'; + const expectedParameters = { + project: 'projectValue', + patch_job: 'patchJobValue', + }; + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.patchJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.patchJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('patchJobPath', () => { + const result = client.patchJobPath('projectValue', 'patchJobValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.patchJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPatchJobName', () => { + const result = client.matchProjectFromPatchJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.patchJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPatchJobFromPatchJobName', () => { + const result = client.matchPatchJobFromPatchJobName(fakePath); + assert.strictEqual(result, 'patchJobValue'); + assert( + (client.pathTemplates.patchJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('vulnerabilityReport', () => { + const fakePath = '/rendered/path/vulnerabilityReport'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = + new osconfigzonalserviceModule.v1.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.vulnerabilityReportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.vulnerabilityReportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('vulnerabilityReportPath', () => { + const result = client.vulnerabilityReportPath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.vulnerabilityReportPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVulnerabilityReportName', () => { + const result = client.matchProjectFromVulnerabilityReportName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.vulnerabilityReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVulnerabilityReportName', () => { + const result = + client.matchLocationFromVulnerabilityReportName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.vulnerabilityReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromVulnerabilityReportName', () => { + const result = + client.matchInstanceFromVulnerabilityReportName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + ( + client.pathTemplates.vulnerabilityReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-osconfig/test/gapic_os_config_zonal_service_v1alpha.ts b/packages/google-cloud-osconfig/test/gapic_os_config_zonal_service_v1alpha.ts new file mode 100644 index 00000000000..ece81748ae0 --- /dev/null +++ b/packages/google-cloud-osconfig/test/gapic_os_config_zonal_service_v1alpha.ts @@ -0,0 +1,4187 @@ +// 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 osconfigzonalserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1alpha.OsConfigZonalServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.osConfigZonalServiceStub, undefined); + await client.initialize(); + assert(client.osConfigZonalServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.osConfigZonalServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.osConfigZonalServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + 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 osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + 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('getOSPolicyAssignment', () => { + it('invokes getOSPolicyAssignment without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ); + client.innerApiCalls.getOsPolicyAssignment = + stubSimpleCall(expectedResponse); + const [response] = await client.getOSPolicyAssignment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOSPolicyAssignment without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ); + client.innerApiCalls.getOsPolicyAssignment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOSPolicyAssignment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOSPolicyAssignment with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOsPolicyAssignment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getOSPolicyAssignment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOSPolicyAssignment with closed client', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getOSPolicyAssignment(request), + expectedError + ); + }); + }); + + describe('getInstanceOSPoliciesCompliance', () => { + it('invokes getInstanceOSPoliciesCompliance without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ); + client.innerApiCalls.getInstanceOsPoliciesCompliance = + stubSimpleCall(expectedResponse); + const [response] = await client.getInstanceOSPoliciesCompliance(request); + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstanceOsPoliciesCompliance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstanceOsPoliciesCompliance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstanceOSPoliciesCompliance without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ); + client.innerApiCalls.getInstanceOsPoliciesCompliance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstanceOSPoliciesCompliance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstanceOsPoliciesCompliance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstanceOsPoliciesCompliance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstanceOSPoliciesCompliance with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstanceOsPoliciesCompliance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getInstanceOSPoliciesCompliance(request), + expectedError + ); + assert(stub.calledOnce); + const actualRequest = ( + client.innerApiCalls.getInstanceOsPoliciesCompliance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstanceOsPoliciesCompliance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstanceOSPoliciesCompliance with closed client', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetInstanceOSPoliciesComplianceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getInstanceOSPoliciesCompliance(request), + expectedError + ); + assert(stub.calledOnce); + }); + }); + + describe('getOSPolicyAssignmentReport', () => { + it('invokes getOSPolicyAssignmentReport without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ); + client.innerApiCalls.getOsPolicyAssignmentReport = + stubSimpleCall(expectedResponse); + const [response] = await client.getOSPolicyAssignmentReport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOsPolicyAssignmentReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOsPolicyAssignmentReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOSPolicyAssignmentReport without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ); + client.innerApiCalls.getOsPolicyAssignmentReport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOSPolicyAssignmentReport( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOsPolicyAssignmentReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOsPolicyAssignmentReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOSPolicyAssignmentReport with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOsPolicyAssignmentReport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getOSPolicyAssignmentReport(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getOsPolicyAssignmentReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOsPolicyAssignmentReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOSPolicyAssignmentReport with closed client', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetOSPolicyAssignmentReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getOSPolicyAssignmentReport(request), + expectedError + ); + }); + }); + + describe('getInventory', () => { + it('invokes getInventory without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetInventoryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetInventoryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ); + client.innerApiCalls.getInventory = stubSimpleCall(expectedResponse); + const [response] = await client.getInventory(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInventory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInventory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInventory without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetInventoryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetInventoryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ); + client.innerApiCalls.getInventory = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInventory( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1alpha.IInventory | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInventory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInventory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInventory with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetInventoryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetInventoryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInventory = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getInventory(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getInventory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInventory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInventory with closed client', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetInventoryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetInventoryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInventory(request), expectedError); + }); + }); + + describe('getVulnerabilityReport', () => { + it('invokes getVulnerabilityReport without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ); + client.innerApiCalls.getVulnerabilityReport = + stubSimpleCall(expectedResponse); + const [response] = await client.getVulnerabilityReport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVulnerabilityReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVulnerabilityReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVulnerabilityReport without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ); + client.innerApiCalls.getVulnerabilityReport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getVulnerabilityReport( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVulnerabilityReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVulnerabilityReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVulnerabilityReport with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getVulnerabilityReport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getVulnerabilityReport(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getVulnerabilityReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVulnerabilityReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVulnerabilityReport with closed client', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.GetVulnerabilityReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getVulnerabilityReport(request), + expectedError + ); + }); + }); + + describe('createOSPolicyAssignment', () => { + it('invokes createOSPolicyAssignment without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createOsPolicyAssignment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createOSPolicyAssignment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createOSPolicyAssignment without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createOsPolicyAssignment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createOSPolicyAssignment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createOSPolicyAssignment with call error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createOsPolicyAssignment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createOSPolicyAssignment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createOSPolicyAssignment with LRO error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.CreateOSPolicyAssignmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createOsPolicyAssignment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createOSPolicyAssignment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateOSPolicyAssignmentProgress without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + 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.checkCreateOSPolicyAssignmentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateOSPolicyAssignmentProgress with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + 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.checkCreateOSPolicyAssignmentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateOSPolicyAssignment', () => { + it('invokes updateOSPolicyAssignment without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest() + ); + request.osPolicyAssignment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest', + ['osPolicyAssignment', 'name'] + ); + request.osPolicyAssignment.name = defaultValue1; + const expectedHeaderRequestParams = `os_policy_assignment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateOsPolicyAssignment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateOSPolicyAssignment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOSPolicyAssignment without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest() + ); + request.osPolicyAssignment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest', + ['osPolicyAssignment', 'name'] + ); + request.osPolicyAssignment.name = defaultValue1; + const expectedHeaderRequestParams = `os_policy_assignment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateOsPolicyAssignment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateOSPolicyAssignment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOSPolicyAssignment with call error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest() + ); + request.osPolicyAssignment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest', + ['osPolicyAssignment', 'name'] + ); + request.osPolicyAssignment.name = defaultValue1; + const expectedHeaderRequestParams = `os_policy_assignment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOsPolicyAssignment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateOSPolicyAssignment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOSPolicyAssignment with LRO error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest() + ); + request.osPolicyAssignment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.UpdateOSPolicyAssignmentRequest', + ['osPolicyAssignment', 'name'] + ); + request.osPolicyAssignment.name = defaultValue1; + const expectedHeaderRequestParams = `os_policy_assignment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOsPolicyAssignment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateOSPolicyAssignment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateOSPolicyAssignmentProgress without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + 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.checkUpdateOSPolicyAssignmentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateOSPolicyAssignmentProgress with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + 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.checkUpdateOSPolicyAssignmentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteOSPolicyAssignment', () => { + it('invokes deleteOSPolicyAssignment without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteOsPolicyAssignment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteOSPolicyAssignment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteOSPolicyAssignment without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteOsPolicyAssignment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteOSPolicyAssignment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteOSPolicyAssignment with call error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteOsPolicyAssignment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteOSPolicyAssignment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteOSPolicyAssignment with LRO error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.DeleteOSPolicyAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteOsPolicyAssignment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteOSPolicyAssignment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteOsPolicyAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteOSPolicyAssignmentProgress without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + 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.checkDeleteOSPolicyAssignmentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteOSPolicyAssignmentProgress with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + 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.checkDeleteOSPolicyAssignmentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listOSPolicyAssignments', () => { + it('invokes listOSPolicyAssignments without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + ]; + client.innerApiCalls.listOsPolicyAssignments = + stubSimpleCall(expectedResponse); + const [response] = await client.listOSPolicyAssignments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignments without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + ]; + client.innerApiCalls.listOsPolicyAssignments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOSPolicyAssignments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignments with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOsPolicyAssignments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listOSPolicyAssignments(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentsStream without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + ]; + client.descriptors.page.listOSPolicyAssignments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listOSPolicyAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment + ) => { + 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.listOSPolicyAssignments + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listOsPolicyAssignments, request) + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignments + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listOSPolicyAssignmentsStream with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOSPolicyAssignments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listOSPolicyAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listOSPolicyAssignments + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listOsPolicyAssignments, request) + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignments + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOSPolicyAssignments without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + ]; + client.descriptors.page.listOSPolicyAssignments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment[] = + []; + const iterable = client.listOSPolicyAssignmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listOSPolicyAssignments + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignments + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOSPolicyAssignments with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOSPolicyAssignments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listOSPolicyAssignmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listOSPolicyAssignments + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignments + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listOSPolicyAssignmentRevisions', () => { + it('invokes listOSPolicyAssignmentRevisions without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + ]; + client.innerApiCalls.listOsPolicyAssignmentRevisions = + stubSimpleCall(expectedResponse); + const [response] = await client.listOSPolicyAssignmentRevisions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignmentRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignmentRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentRevisions without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + ]; + client.innerApiCalls.listOsPolicyAssignmentRevisions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOSPolicyAssignmentRevisions( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignmentRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignmentRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentRevisions with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOsPolicyAssignmentRevisions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listOSPolicyAssignmentRevisions(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignmentRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignmentRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentRevisionsStream without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + ]; + client.descriptors.page.listOSPolicyAssignmentRevisions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listOSPolicyAssignmentRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment + ) => { + 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.listOSPolicyAssignmentRevisions + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listOsPolicyAssignmentRevisions, + request + ) + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listOSPolicyAssignmentRevisionsStream with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOSPolicyAssignmentRevisions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listOSPolicyAssignmentRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listOsPolicyAssignmentRevisions, + request + ) + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOSPolicyAssignmentRevisions without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignment() + ), + ]; + client.descriptors.page.listOSPolicyAssignmentRevisions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment[] = + []; + const iterable = client.listOSPolicyAssignmentRevisionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOSPolicyAssignmentRevisions with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOSPolicyAssignmentRevisions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listOSPolicyAssignmentRevisionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentRevisions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInstanceOSPoliciesCompliances', () => { + it('invokes listInstanceOSPoliciesCompliances without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ), + ]; + client.innerApiCalls.listInstanceOsPoliciesCompliances = + stubSimpleCall(expectedResponse); + const [response] = await client.listInstanceOSPoliciesCompliances( + request + ); + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstanceOsPoliciesCompliances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstanceOsPoliciesCompliances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstanceOSPoliciesCompliances without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ), + ]; + client.innerApiCalls.listInstanceOsPoliciesCompliances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstanceOSPoliciesCompliances( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstanceOsPoliciesCompliances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstanceOsPoliciesCompliances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstanceOSPoliciesCompliances with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstanceOsPoliciesCompliances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listInstanceOSPoliciesCompliances(request), + expectedError + ); + assert(stub.calledOnce); + const actualRequest = ( + client.innerApiCalls.listInstanceOsPoliciesCompliances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstanceOsPoliciesCompliances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstanceOSPoliciesCompliancesStream without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ), + ]; + client.descriptors.page.listInstanceOSPoliciesCompliances.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInstanceOSPoliciesCompliancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert(stub.calledOnce); + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listInstanceOSPoliciesCompliances + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listInstanceOsPoliciesCompliances, + request + ) + ); + assert( + ( + client.descriptors.page.listInstanceOSPoliciesCompliances + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstanceOSPoliciesCompliancesStream with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstanceOSPoliciesCompliances.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstanceOSPoliciesCompliancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert(stub.calledOnce); + assert( + ( + client.descriptors.page.listInstanceOSPoliciesCompliances + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listInstanceOsPoliciesCompliances, + request + ) + ); + assert( + ( + client.descriptors.page.listInstanceOSPoliciesCompliances + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstanceOSPoliciesCompliances without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance() + ), + ]; + client.descriptors.page.listInstanceOSPoliciesCompliances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance[] = + []; + const iterable = client.listInstanceOSPoliciesCompliancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert(stub.calledOnce); + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstanceOSPoliciesCompliances + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listInstanceOSPoliciesCompliances + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstanceOSPoliciesCompliances with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInstanceOSPoliciesCompliancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstanceOSPoliciesCompliances.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstanceOSPoliciesCompliancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1alpha.IInstanceOSPoliciesCompliance[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert(stub.calledOnce); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstanceOSPoliciesCompliances + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listInstanceOSPoliciesCompliances + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listOSPolicyAssignmentReports', () => { + it('invokes listOSPolicyAssignmentReports without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ), + ]; + client.innerApiCalls.listOsPolicyAssignmentReports = + stubSimpleCall(expectedResponse); + const [response] = await client.listOSPolicyAssignmentReports(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignmentReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignmentReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentReports without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ), + ]; + client.innerApiCalls.listOsPolicyAssignmentReports = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOSPolicyAssignmentReports( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignmentReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignmentReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentReports with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOsPolicyAssignmentReports = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listOSPolicyAssignmentReports(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listOsPolicyAssignmentReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOsPolicyAssignmentReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOSPolicyAssignmentReportsStream without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ), + ]; + client.descriptors.page.listOSPolicyAssignmentReports.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listOSPolicyAssignmentReportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + ) => { + 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.listOSPolicyAssignmentReports + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listOsPolicyAssignmentReports, + request + ) + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listOSPolicyAssignmentReportsStream with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOSPolicyAssignmentReports.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listOSPolicyAssignmentReportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listOsPolicyAssignmentReports, + request + ) + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOSPolicyAssignmentReports without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.OSPolicyAssignmentReport() + ), + ]; + client.descriptors.page.listOSPolicyAssignmentReports.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport[] = + []; + const iterable = client.listOSPolicyAssignmentReportsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOSPolicyAssignmentReports with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListOSPolicyAssignmentReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOSPolicyAssignmentReports.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listOSPolicyAssignmentReportsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1alpha.IOSPolicyAssignmentReport[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listOSPolicyAssignmentReports + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInventories', () => { + it('invokes listInventories without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ), + ]; + client.innerApiCalls.listInventories = stubSimpleCall(expectedResponse); + const [response] = await client.listInventories(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInventories as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInventories as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInventories without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ), + ]; + client.innerApiCalls.listInventories = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInventories( + request, + ( + err?: Error | null, + result?: protos.google.cloud.osconfig.v1alpha.IInventory[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInventories as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInventories as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInventories with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInventories = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listInventories(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listInventories as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInventories as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInventoriesStream without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ), + ]; + client.descriptors.page.listInventories.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInventoriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1alpha.Inventory[] = []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1alpha.Inventory) => { + 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.listInventories.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInventories, request) + ); + assert( + (client.descriptors.page.listInventories.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInventoriesStream with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInventories.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInventoriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1alpha.Inventory[] = []; + stream.on( + 'data', + (response: protos.google.cloud.osconfig.v1alpha.Inventory) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listInventories.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInventories, request) + ); + assert( + (client.descriptors.page.listInventories.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInventories without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.Inventory() + ), + ]; + client.descriptors.page.listInventories.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1alpha.IInventory[] = []; + const iterable = client.listInventoriesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listInventories.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInventories.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInventories with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListInventoriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListInventoriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInventories.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInventoriesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1alpha.IInventory[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listInventories.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInventories.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listVulnerabilityReports', () => { + it('invokes listVulnerabilityReports without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ), + ]; + client.innerApiCalls.listVulnerabilityReports = + stubSimpleCall(expectedResponse); + const [response] = await client.listVulnerabilityReports(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVulnerabilityReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVulnerabilityReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVulnerabilityReports without error using callback', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ), + ]; + client.innerApiCalls.listVulnerabilityReports = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVulnerabilityReports( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVulnerabilityReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVulnerabilityReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVulnerabilityReports with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listVulnerabilityReports = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listVulnerabilityReports(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listVulnerabilityReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVulnerabilityReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVulnerabilityReportsStream without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ), + ]; + client.descriptors.page.listVulnerabilityReports.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listVulnerabilityReportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1alpha.VulnerabilityReport[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1alpha.VulnerabilityReport + ) => { + 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.listVulnerabilityReports + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listVulnerabilityReports, request) + ); + assert( + ( + client.descriptors.page.listVulnerabilityReports + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listVulnerabilityReportsStream with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVulnerabilityReports.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listVulnerabilityReportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.osconfig.v1alpha.VulnerabilityReport[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.osconfig.v1alpha.VulnerabilityReport + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listVulnerabilityReports + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listVulnerabilityReports, request) + ); + assert( + ( + client.descriptors.page.listVulnerabilityReports + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVulnerabilityReports without error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ), + generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.VulnerabilityReport() + ), + ]; + client.descriptors.page.listVulnerabilityReports.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport[] = + []; + const iterable = client.listVulnerabilityReportsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listVulnerabilityReports + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listVulnerabilityReports + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVulnerabilityReports with error', async () => { + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.osconfig.v1alpha.ListVulnerabilityReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVulnerabilityReports.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVulnerabilityReportsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.osconfig.v1alpha.IVulnerabilityReport[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listVulnerabilityReports + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listVulnerabilityReports + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('instanceOSPoliciesCompliance', () => { + const fakePath = '/rendered/path/instanceOSPoliciesCompliance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instanceOSPoliciesCompliancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instanceOSPoliciesCompliancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instanceOSPoliciesCompliancePath', () => { + const result = client.instanceOSPoliciesCompliancePath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.instanceOSPoliciesCompliancePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInstanceOSPoliciesComplianceName', () => { + const result = + client.matchProjectFromInstanceOSPoliciesComplianceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.instanceOSPoliciesCompliancePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInstanceOSPoliciesComplianceName', () => { + const result = + client.matchLocationFromInstanceOSPoliciesComplianceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.instanceOSPoliciesCompliancePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceOSPoliciesComplianceName', () => { + const result = + client.matchInstanceFromInstanceOSPoliciesComplianceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + ( + client.pathTemplates.instanceOSPoliciesCompliancePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('inventory', () => { + const fakePath = '/rendered/path/inventory'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.inventoryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.inventoryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('inventoryPath', () => { + const result = client.inventoryPath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.inventoryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInventoryName', () => { + const result = client.matchProjectFromInventoryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInventoryName', () => { + const result = client.matchLocationFromInventoryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInventoryName', () => { + const result = client.matchInstanceFromInventoryName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('oSPolicyAssignment', () => { + const fakePath = '/rendered/path/oSPolicyAssignment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + os_policy_assignment: 'osPolicyAssignmentValue', + }; + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.oSPolicyAssignmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.oSPolicyAssignmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('oSPolicyAssignmentPath', () => { + const result = client.oSPolicyAssignmentPath( + 'projectValue', + 'locationValue', + 'osPolicyAssignmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.oSPolicyAssignmentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromOSPolicyAssignmentName', () => { + const result = client.matchProjectFromOSPolicyAssignmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOSPolicyAssignmentName', () => { + const result = client.matchLocationFromOSPolicyAssignmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchOsPolicyAssignmentFromOSPolicyAssignmentName', () => { + const result = + client.matchOsPolicyAssignmentFromOSPolicyAssignmentName(fakePath); + assert.strictEqual(result, 'osPolicyAssignmentValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('oSPolicyAssignmentReport', () => { + const fakePath = '/rendered/path/oSPolicyAssignmentReport'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + assignment: 'assignmentValue', + }; + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.oSPolicyAssignmentReportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.oSPolicyAssignmentReportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('oSPolicyAssignmentReportPath', () => { + const result = client.oSPolicyAssignmentReportPath( + 'projectValue', + 'locationValue', + 'instanceValue', + 'assignmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromOSPolicyAssignmentReportName', () => { + const result = + client.matchProjectFromOSPolicyAssignmentReportName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOSPolicyAssignmentReportName', () => { + const result = + client.matchLocationFromOSPolicyAssignmentReportName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromOSPolicyAssignmentReportName', () => { + const result = + client.matchInstanceFromOSPolicyAssignmentReportName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssignmentFromOSPolicyAssignmentReportName', () => { + const result = + client.matchAssignmentFromOSPolicyAssignmentReportName(fakePath); + assert.strictEqual(result, 'assignmentValue'); + assert( + ( + client.pathTemplates.oSPolicyAssignmentReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('vulnerabilityReport', () => { + const fakePath = '/rendered/path/vulnerabilityReport'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = + new osconfigzonalserviceModule.v1alpha.OsConfigZonalServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.vulnerabilityReportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.vulnerabilityReportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('vulnerabilityReportPath', () => { + const result = client.vulnerabilityReportPath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.vulnerabilityReportPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVulnerabilityReportName', () => { + const result = client.matchProjectFromVulnerabilityReportName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.vulnerabilityReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVulnerabilityReportName', () => { + const result = + client.matchLocationFromVulnerabilityReportName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.vulnerabilityReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromVulnerabilityReportName', () => { + const result = + client.matchInstanceFromVulnerabilityReportName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + ( + client.pathTemplates.vulnerabilityReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-osconfig/tsconfig.json b/packages/google-cloud-osconfig/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-osconfig/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-osconfig/webpack.config.js b/packages/google-cloud-osconfig/webpack.config.js new file mode 100644 index 00000000000..eb0a92bea1c --- /dev/null +++ b/packages/google-cloud-osconfig/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: 'OsConfigServiceClient', + filename: './os-config-service-client.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; diff --git a/release-please-config.json b/release-please-config.json index 7d5f77b694d..8775758e665 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -30,6 +30,7 @@ "packages/google-cloud-language": {}, "packages/google-cloud-memcache": {}, "packages/google-cloud-monitoring": {}, + "packages/google-cloud-osconfig": {}, "packages/google-cloud-oslogin": {}, "packages/google-cloud-phishingprotection": {}, "packages/google-cloud-policytroubleshooter": {},